sliver__

3.4 Division 본문

CS/컴퓨터 구조

3.4 Division

sliver__ 2023. 11. 6. 09:18
728x90

Example of division

 

Relationship between components

 

A Division Algorithm and Hardware

First version of the division hardware

The 32-bit Quotient register set to 0.

Each iteration of the algorithm needs to move the divisor to the right one digit, so we start with the divisor placed in the left half of the 64-bit Divisor register and shift it right 1 bit each step to align it with the dividend.

The Remainder register is initialized with the dividend.

 

A division algorithm, using above the hardware

 

Example)

Using a 4-bit version of the algorithm to save pages, let’s try dividing 7ten by 2ten, or 0000 0111two by 0010two.

 

Answer)

 

An improved version of the division hardware.

The Divisor register, ALU, and Quotient register are all 32 bits wide, with only the Remainder register left at 64 bits.

Comparing with first version of ALU and Divisor registers are halved and the remainder is shifted left.

This version also combines the Quotient register with the right half of the Remainder register.

 

Signed Division

 

The simplest solution is to remember the signs of the divisor and dividend and then negate the quotient if the signs disagree.

 

 

 

MIPS core architecture

 

728x90

'CS > 컴퓨터 구조' 카테고리의 다른 글

3.3 Multiplication  (0) 2023.11.06
3.2 Addition and Subtraction  (0) 2023.11.03
2.17 Real Stuff : x86 Instruction  (1) 2023.10.31
2.16 Real Stuff: ARMv7 (32-bit) Instructions  (0) 2023.10.23
2.14 Arrray versus Pointers  (1) 2023.10.22
Comments