CS104: Computer Organization: 11 March, 2020
CS104: Computer Organization: 11 March, 2020
CS104: Computer Organization: 11 March, 2020
11/03/2020
Computer Keyboard,
Memory Devices Mouse
Processor Disk
(passive)
Input (where
Control (where programs,
programs, Output data live
data live when not
Datapath when running)
running) Display,
Printer
L9
11/03/2020
The CPU
• Processor (CPU): the active part of the
computer that does all the work (data
manipulation and decision-making)
• Datapath: portion of the processor that
contains hardware necessary to perform
operations required by the processor (the
brawn)
• Control: portion of the processor (also in
hardware) that tells the datapath what needs
to be done (the brain)
L9
11/03/2020
registers
rd
instruction
memory
PC
rs
memory
ALU
Data
rt
+4 imm
reg[1]+
reg[1] reg[2]
registers
instruction 3
memory
PC
memory
reg[2] ALU
Data
2
imm
+4
add r3, r1, r2
L9
11/03/2020
reg[1]
reg[1]
<17?
registers
instruction x
memory
PC
memory
ALU
Data
3
imm 17
+4
slti r3, r1, 17
L9
11/03/2020
reg[1]
reg[1]
+17
registers
x
instruction
memory
PC
memory
reg[3] ALU
Data
3
imm 17
+4
MEM[r1+17]<=r3
SW r3, 17(r1)
L9
11/03/2020
reg[1]
reg[1]
x +17
registers
instruction
memory
PC
memory
ALU
Data
3
MEM[r1+17]
imm 17
+4
LW r3, 17(r1)
L9
11/03/2020
registers
rd
instruction
memory
PC
rs
memory
ALU
Data
rt
+4 imm
opcode, funct
Controller
L9
11/03/2020
1 bit ALU
• Using a MUX we can add the AND, OR, and
adder operations into a single ALU
Cin ALUOp
Mux
Result
1-bit
Full
B Adder
Cout
L9
11/03/2020
4 bit ALU
ALUop ALUop
CIn0 3
A0 1-bit A
Result0
B0 ALU 4
CIn1 COut0
A1 1-bit
Result1
B1 ALU
CIn2 COut1
A2 1-bit
Result2
B2 ALU
CIn3 COut2
A3 1-bit Result3
B3 ALU B COut3
COut3 4
L9
11/03/2020
Combinational Elements
Carry_In Select
A
32
Adder
A
32
MUX
Sum
32 32 Y
32
B Carry B
32
Adder MUX
OP
A
32
ALU
Result
32
B Zero
32
ALU
L9
11/03/2020
D Latches
• Modified SR Latch
• Latches value when C is asserted
C
Q
Q
D
L9
11/03/2020
D Flip Flop
• Uses Master/Slave D Latches
D D D Q D D Q Q
C Latch Q C Latch Q Q
CLK
L9
11/03/2020
Clk
Setup Hold Setup Hold
Don’t Care
. . . .
. . . .
. . . .
L9
11/03/2020
Summary