




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: COMPUTR ORGZTN & ASSMBLY LANG; Subject: Computer Science; University: University of Pittsburgh; Term: Unknown 1989;
Typology: Study notes
1 / 8
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 2
Binary arithmeticBinary arithmetic
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Binary number representationsBinary number representations
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Method 1: signMethod 1: sign magnitude-magnitude
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 5
Method 2: oneMethod 2: one s complement’s complement
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 6
Method 3: twoMethod 3: two s complement’s complement
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
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
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 14
C language exampleC language example
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
SubtractionSubtraction
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 17
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 18
C (^) out: carry out
(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
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
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 26
2: shift right (^) 0000 1100
BoothBooth s encoding’s encoding
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
BoothBooth s encoding’s encoding
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
BoothBooth s algorithm in action’s algorithm in action
Iteration Multiplicand
Booth’s algorithm Step Product 0 0010 initial values^ 0000 1101 0
1 0010
10 -> product = product – multiplicand 1110 1101 0 shift rightg (^) 1111 0110 1
2 0010
01 -> product = product + multiplicand 0001 0110 1 shift right (^) 0000 1011 0 10 -> product = (^) 1110 1011 0 3 0010
10 > product product – multiplicand 1110 1011 0 shift right 1111 0101 1
4 0010
11 -> no op (^) 1111 0101 1
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
shift right (^) 1111 1010 1
BoothBooth s algorithm in action’s algorithm in action
IterationIteration MultiplicandMultiplicand Booth’s algorithm Step Product 0 1
2
33
4
5
6
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh