









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Dept. of Computer Science University of Pittsburgh
Five classic componentsFive classic components
I am like a controlI am like a control I am like a pack offile folders tower file folders
I am like a conveyor
I exchange information with outside world belt + service stations
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Binary arithmeticBinary arithmetic
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 3
Binary number representationsBinary number representations
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Method 3: twoMethod 3: two s complement’s complement
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 7
SummarySummary
Code Sign-Magnitude 1’s Complement 2’s Complement 000 +0 +0 + 001 +1 +1 + 010 +2 +2 + 011 +3 +3 + 100 -0 -3 - 101101 -1-1 -2-2 -3- 110 -2 -1 - 111 -3 -0 -
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
When NWhen N = 32 32
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 9
TwoTwo s complement operations’s complement operations
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
What is zero extension?
What happens on overflow?What happens on overflow?
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 13
MIPS exampleMIPS example
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
C language exampleC language example
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 15
SubtractionSubtraction
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
(0)
carry in at each stage
(0) (1) (1) (0) (0)
0 0 1 1 1
0 0 1 1 0
(0) 0 (0) 1 (1) 1 (1) 0 (0) 1
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 19
carry out at each stage
Input Output A B C (^) in C (^) out S 0 0 0 0 0 0 0 1 0 1 00 11 00 00 11 0 1 1 1 0 1 0 0 0 1 11 00 11 11 00 1 1 0 1 0 1 1 1 1 1
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
MultiplicationMultiplication
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 21
Straightforward algorithmStraightforward algorithm
01010010 (multiplicand) xx 0110110101101101 (multiplier)(multiplier)
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Hardware design 3Hardware design 3
32-bit ALU
64-bit shift register
Removed a 32-bit shift register!
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 25
g
ExampleExample
Iteration Multiplicand
Implementation 3 Step Product 0 0010 initial values 0000 0110
1 0010
1: 0 -> no op (^) 0000 0110 2: shift right (^) 0000 0011
2 0010
1: 1 -> product = product + multiplicand 0010 0011 2: shift right 0001 0001 1: 1 -> product = 3 0010 product + multiplicandproduct + multiplicand^ 0011 0001 2: shift right 0001 1000
4 0010
1: 0 -> no op 0001 1000 2: shift right 0000 1100
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
2: shift right 0000 1100
BoothBooth s encoding’s encoding
11111111 (two’s complement) 0000000 1 (Booth’s encoding)0000000-1 (Booth s encoding)
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 27
BoothBooth s encoding’s encoding
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh