Documente Academic
Documente Profesional
Documente Cultură
Slide 1
IR0
Control Unit
IR
ClkIR
SelA MUX
8
F-ALU A ClkA
8 8
A B Res
8
B ClkB SelC
1
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 2
O7
MUX
I1 I0
0 1 0 1
Slide 4
f2 f1 f0
Cout
ALU
On-1
O1 O0
Selection Bits/Results 000 000 zero 001 B-A minus 010 A-B minus 011 A+B plus 100 A B xor 101 A or B or 110 A B and
Slide 5
111 1111 -1
In-1 SHIFTER I1 I0
On-1 O1 O0
Cin
Slide 6
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 7
Instruction Format
IR7 IR6 IR4 IR3 IR1 IR0
SelA
SelCY
The multiplexers are controlled by bits 0 and 7 of the instruction SELA 0-1 Selects the input to the A register 0 selects shifter output, 1 selects external Data Input.
SELCY 0-1 Selects the input to the CARRY-in of the ALU: 0 selects logic 1, 1 selects C-out
DOC 112: Computer Hardware Lecture 15 Slide 8
SelA
SelCY
SELALU bits 4, 5 and 6 selects the ALU output: 000 ZERO 001 B-mi-A
010 A-mi-B 011 A-pl-B 100 A-xor-B 101 A-or-B 110 A-and-B 111 MINUS ONE
DOC 112: Computer Hardware Lecture 15 Slide 9
SelA
SelALU
SelSHFT
SelCY
Instruction Register IR
SELSHIFT Selects the shift function: 000: Unchanged 010: Rotate Right 100: Unchanged 110: Arithmetic right shift 001: Arithmetic Left Shift 011: Logical right shift 101: Left shift with carry 111: Right shift with carry
Slide 10
Slide 11
Slide 12
Slide 13
The Program
The execution cycle implicitly defines the format of the program. At each step a new item arrives on the data in lines synchronised with the system clock.
Operation Code 1 Data 1 Data 2 Operation Code 2 Unused
Instruction
Instruction
Instruction
etc.
Slide 14
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 15
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 16
Step 2: A receives a clock pulse. It might be loaded from the Data In lines
Data In
8 8
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 17
Step 3: B and C receive a clock pulse. B is loaded from the Data In lines
Data In
8 8
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 18
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 19
Step 5: Res and C receive a clock pulse. They are loaded from the ALU/Shifter
Data In
8 8
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 20
Step 1 (again): IR receives a clock pulse. It is loaded from the Data In lines
Data In
8 8
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 21
Step 2 (again): A receives a clock pulse. It might be loaded from the ALU/Shifter
Data In
8 8
IR7
IR0
Control Unit
IR
ClkIR
IR7
MUX
A ClkA
8
A B Res
8
B ClkB
IR0 1
SHIFTER
RES ClkR
Data Out
ALU
CY-in CY-out C ClkC
MUX
Carry Out
Slide 22
Slide 23
Slide 24
Slide 25
Slide 26
Thus, if the OPERATE/IDLE signal is at logical 0 the system drops into the IDLE state immediately and the processor is ready to start working properly.
Slide 27
ClkA
Slide 29
The processor is in the IDLE state Input is loaded in the IR register. ALU is set to 00000000, shifter = unchanged. Because IR7=1 the Data In lines are loaded onto register A.
Slide 30
1. Set OPERATE/IDLE to 1 Set input data to 10000000 & apply one clock pulse. 2. Set number A on the Data In lines & apply one clock pulse
DOC 112: Computer Hardware Lecture 15
B is loaded from the Data In lines and C is loaded from the ALU carry which is 0 The IR register is loaded from the Data In line. The ALU is set to A plus B and the shifter to logical shift right. The result (A+B)/2 is clocked into the RES register, the C bit indicates overflow
Slide 31
4. Set the Data In lines to to 00110111 and apply one clock pulse. 5. Apply one clock pulse.
Instruction
Instruction
Instruction
Slide 32
At last:
We have succeeded in executing one program instruction! Well take a look at getting the instructions in and the results out next time.
Slide 33