Computer Organization Chapter 5 Lecture 15 - Lecture 18
Computer Organization Chapter 5 Lecture 15 - Lecture 18
EL-SAYED ABDEL-RAHMAN
[email protected]
OFFICE: EELU- AIN SHAMS CENTRE.
PHONE: 33318447
Chapter 5
BASIC COMPUTER ORGANIZATION
AND DESIGN
4
© Korea Univ. of Tech. & Edu.
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. & Comm.
5-5
Architecture & Organization
• Computer Registers
• Computer Instructions
• Instruction Cycle
instruction code
The ability to store and execute instructions, the stored program
concept, is the most important property of a general-purpose computer.
An instruction code is a group of bits that instruct the computer to
perform a specific operation. 15 12 11 0
A group of bits that define such operations as add, subtract, multiply, shift, and
complement(bit 12-15 : 24 = 16 distinct operations)
© Korea Univ. of Tech. & Edu.
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. & Comm.
5-13
Stored Program Organization
Addressing Mode
Immediate operand address :
» the second part of an instruction code(address field) specifies an operand
Direct operand address : Fig. 5-2(b)
» the second part of an instruction code specifies the address of an operand
Indirect operand address : Fig. 5-2(c)
I=0 : Direct,
I=1 : Indirect » the bits in the second part of the instruction designate an address of a memory word
in which the address of the operand is found (Pointer)
One bit of the instruction code is used to distinguish between a direct and an
indirect address : Fig. 5-2(a)
© Korea Univ. of Tech. & Edu.
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. & Comm.
5-16
Direct & indirect address
Effective Address
The address, that can be directly used without modification to access an operand for
a computation-type instruction, or as the target address for a branch-type instruction
5-2 Computer Registers
List of Registers for the Basic Computer : Tab. 5-1
Basic computer registers and memory : Fig. 5-3
Data Register(DR) : hold the operand(Data) read from memory
Accumulator Register(AC) : general purpose processing register
Instruction Register(IR) : hold the instruction read from memory
Temporary Register(TR) : hold a temporary data during processing
Address Register(AR) : hold a memory address, 12 bit width
Program Counter(PC) : hold the address of the next instruction to be read from
memory after the current instruction is executed
» Accumulator(AC) : 3 Path
s2
1) Register Microoperation : clear AC, s1 Bus
shfift AC,… Memory unit
s0
7
4096× 16 Address
2) Data Register : add DR to AC, and
DR to AC(AC
Write Read
AR
1
LD INR CLR
3) INPR : Device(Adder & Logic) PC 2
» Note) Two microoperations can be LD INR CLR
INPR
IR 5
LD
TR
6
LD INR CLR
OUTR
Clock
LD
Either one of the registers will have its load signal activated, or
the memory will have its read signal activated
Will determine where the data from the bus gets loaded
The 12-bit registers, AR and PC, have 0’s loaded onto the bus
in the high order 4 bit positions
When the 8-bit register OUTR is loaded from the bus, the data
comes from the low order 8 bits on the bus
1 1 1 1 I/O Operation
EL-SAYED ABDEL-RAHMAN
[email protected]
OFFICE: EELU- AIN SHAMS CENTRE.
PHONE: 33318447
Functional Instructions
- Arithmetic, logic, and shift instructions
- ADD, CMA, INC, CIR, CIL, AND, CLA (other than
ADD/AND?)
Transfer Instructions
- Data transfers between the main memory
and the processor registers
- LDA, STA
Control Instructions
- Program sequencing and control
- BUN, BSA, ISZ
Input/Output Instructions
- Input and output
- INP, OUT
© Korea Univ. of Tech. & Edu.
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. & Comm.
Instruction codes
5-31
CONTROL UNIT
+ Timing Signal I D0
.
.
Timing Signal = 4 X 16 Decoder + D7 .
Control
Control
outputs
logic
4-bit Sequence Counter gates
T 15
Control timing : Fig. 5-7 .
.
T0
» Sequence Counter is cleared when
.
.
.
.
15 14 1 0
.
.
.
D3T4 =1 : D3T4 : SC 0 4× 16
decoder
Memory R/W cycle time > Clock
cycle time
Increment(INR)
4-bit
» . sequence
Clear(CLR)
counter
(SC)
Clock
• Inputs to the control unit come from IR where an instruction read from the memory
unit is stored.
• A hardwired control is implemented in the example computer using:
> A 3 x 8 decoder to decode opcode bits 12-14 into signals D0, ..., D7;
> A 4-bit binary sequence counter (SC) to count from 0 to 15 to achieve time
sequencing;
> A 4 x 16 decoder to decode the output of the counter into 16 timing signals, T0, ...,
T15
> A flip-flop (I) to store the addressing mode bit in IR;
> A digital circuit with inputs—D0, ..., D7, T0, ..., T15, I, and address bits (11-0) in
IR—to generate control outputs supplied to control inputs and select signals of the
registers and the bus.
• Clocking principle: The binary counter goes through a cycle, 0000 0001 0010
... 1111 0000. Accordingly only one of T0, ..., T15 is 1 at each clock cycle, T0
T1 T2 ... T15 T0; all the other timing signals are 0.
• By setting the clear input (CLR) of SC at a clock cycle, say T3, we can achieve a 4-
cycle clock: T0 T1 T2 T3 T0.
T0 = 1 T0 : AR PC
» 1) Place the content of PC onto the bus by making the bus selection inputs S2S1S0=010
» 2) Transfer the content of the bus to AR by enabling the LD input of AR
© Korea Univ. of Tech. & Edu.
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. & Comm.
5-39
T1 = 1 T1 : IR M [ A R ], P C P C 1
» 1) Enable the read input memory
» 2) Place the content of memory onto the bus by making S2S1S0= 111
» 3) Transfer the content of the bus to IR by enable the LD input of IR
» 4) Increment PC by enabling the INR input of PC
Read
Clock
Common bus
T0
T1
T2
T3
T4
D3
CLR
SC
IR(12,13,14)
3X8 D7 : Register or I/O = 1 = 111 Decode operation code in IR(12-14)
T2
AR IR(0-11), I I(15)
Decoder D6 - D0 : 7 Memory Ref.
Instruction(Tab. 5-4) (Register or I/O) = 1
I
0 = (Memory-reference
AND to AC
(I/O) = 1 0 = (register) (indirect) = 1 0 = (direct)
D 0 T 4 : DR M [ A R ] I I
D 0 T 5 : A C A C DR , SC 0 T3 T3 T3 T3
Execute Execute
ADD to AC
AR M[AR] Nothing
input-output register-reference
instruction instruction
SC 0 SC 0
D 1T 4 : DR M [ A R ]
Execute
D 1T 5 : A C A C DR , E C o u t , SC 0 memory-reference
instruction
SC 0