Chap. 5 Basic Computer Org. and Design: 5-1 Instruction Codes
Chap. 5 Basic Computer Org. and Design: 5-1 Instruction Codes
Chap. 5 Basic Computer Org. and Design: 5-1 Instruction Codes
A group of bits that define such operations as add, subtract, multiply, shift, and
complement(bit 12-15 : 24 = 16 가지 distinct operations)
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-2
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, » the bits in the second part of the instruction designate an address of a memory word
I=1 : Indirect 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)
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-3
Effective Address
The operand address in computation-type instruction or the target address in 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
» Instruction words are read and executed in sequence unless a branch instruction is
encountered
» A branch instruction calls for a transfer to a nonconsecutive instruction in the program
» The address part of a branch instruction is transferred to PC to become the address of
the next instruction
» To read instruction, memory read cycle is initiated, and PC is incremented by one(next
instruction fetch)
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-4
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-5
됨) LD INR CLR
executed
DR AC : sats sthe same
100 time
(4), DR (load )
LD INR CLR
2 1 0
INPR
IR 5
LD
TR
6
LD INR CLR
OUTR
Clock
LD
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-6
1 1 1 1 I/O Operation
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-7
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-8
7 6 5 4 3 2 1 0
+ Timing Signal
I D0
Timing Signal = 4 X 16 Decoder + .
.
D7 . Control
Control
4-bit Sequence Counter logic
outputs
gates
Exam) Control timing : Fig. 5-7 T 15
.
.
.
.
D3T4 =1 : D3T4 : SC 0 15 14 1 0
.
.
.
4× 16
Memory R/W cycle time > Clock decoder
cycle time
» 만약 위와 같이 가정하지 않으면, wait
Increment(INR)
4-bit
sequence
cycle을 추가해야 함.
Clear(CLR)
counter
(SC)
Clock
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-9
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
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-10
T1 = 1 T1 : IR M [ AR], PC PC 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
Fig. 5-11
Flowchart for instruction cycle(Initial Common bus
T0
Instruction (Tab. 5-3) AR PC
IR(12,13,14)
3X8 D7 : Register or I/O = 1 = 111 Decode operation code in IR(12-14)
T2
D6 - D0 : 7 개의 Memory Ref.
AR IR(0-11), I I(15)
Decoder
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)
D0T4 : DR M [ AR] I I
D0T5 : AC AC 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
D1T4 : DR M [ AR]
Execute
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-12
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-13
Program Interrupt
I/O Transfer Modes
» 1) Programmed I/O, 2) Interrupt-initiated I/O, 3) DMA, 4) IOP
» 본 교과서에서는 2) Interrupt-initiated I/O 방식 사용(FGI 또는 FGO가 1이면 Int. 발생)
» Maskable Interrupt 사용( ION 또는 IOF 명령을 사용하여 Int. mask 가능)
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-14
» During the execute phase, IEN is checked by the control Fetch and decode
Store return address
instruction
in location 0
IEN = 0 : the programmer does not want to use the interrupt, M[0] PC
=1
IEN = 1 : the control circuit checks the flag bit, If either flag Branch to location 1
PC 1
=1
set to 1, R F/F is set to 1 FGI
=0
» At the end of the execute phase, control checks the value of R =1 IEN 0
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-15
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-16
Register Control : AR
12 12
Control inputs of AR : LD, INR, CLR From Bus AR To Bus
Clock
AR ? Find all the statements that change the AR D' 7
I
LD INR CLR
pB6 : IEN 0 R
T2
RT2 : IEN 0
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-17
Bus Control
Encoder for Bus Selection : Tab. 5-7
» S0 = x1 + x3 + x5 + x7
» S1 = x2 + x3 + x6 + x7
» S0 = x4 + x5 + x5 + x7
x1 = 1 : Bus AR Find ? AR x1
» D T : PC AR x2
S0
4 4 x3 Multiplexer
D5T5 : PC AR x4
x5
Encoder S1 Bus Select
S2 Input
x6
» Control Function : x1 D4T4 D5T5 x7
x2 = 1 : Bus PC Find ? PC
“
“
x7 = 1 : Bus Memory Find ? M [ AR]
» Same as Memory Read
» Control Function : x7 R' T1 D7 ' IT3 ( D0 D1 D2 D3 )T4
»
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-18
16
Control
Fig. 5-20 gates
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-19
16 16
From adder AC To Bus
and logic
Clock
LD INR CLR
D0 AND
T5
D0T5 : AC AC DR D1 ADD
D1T5 : AC AC DR
D2
D2T5 : AC DR DR
T5
pB11 : AC (0 7) INPR LD p INPR
rB9 : AC AC B 11
r
rB7 : AC shr AC , AC (15) E COM
B9
rB6 : AC shr AC , AC (0) E SHR
rB11 : AC 0 CLR B7
INC
B5
CLR
B 11
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-20
DR(i) AC(i)
INPR
From
INPR
bit(i)
Clock
* Fig. 2-11 로 대체 가능
COM
Increment, Clear,
Count 기능
SHR
AC(i+1)
SHL
AC(i-1)
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer
5-21
Mano Machine
Computer System Architecture Chap. 5 Basic Computer Organization and Design Dept. of Info. Of Computer