Professional Documents
Culture Documents
Basic Computer
Organization and Design
Purpose of This Chapter
In this chapter we introduce a basic
computer and show how its operation
can be specified with register transfer
statements.
Instruction Codes
A process is controlled by a program
A program is a set of instructions that
Computer instruction
Instruction encodings
Number of Operands per
instruction
No OperandsHALT NOP
1 operand NOT R4 R4 R4
IR 0101
010101010101
The address register is connected to the
memory
+1
The Program Counter points to PC
the next address of the program
000000000010
00000001
Addressing
Mode
Mano’s Computer Figure 5-4 s0 s1 s2
Bus
Memory Unit
7
4096x16
Address
WRITE READ
AR 1
LD INR CLR
PC 2
LD INR CLR
DR 3
LD INR CLR
Adder E
& Logic
AC 4
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
Computer System Architecture, Mano, Copyright (C) 1993 Prentice-Hall, Inc.
Computer Registers
–Accumulator(AC) : takes input from ALU
»The ALU takes input from DR, AC and INPR :
»ADD DR to AC, AND DR to AC
–Note) Input register is not connected to the bus.
–The input register is connected only to the ALU
5-2 Computer Registers
Data Register(DR) : hold the operand(Data) read from memory
Adder E
& Logic
AC 4
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
Computer System Architecture, Mano, Copyright (C) 1993 Prentice-Hall, Inc.
Common Bus System
The connection of the registers and memory of
the basic computer to a common bus system :
12 bits
Mano’s Example of Basic Computer (Section 5.9)
The basic computer consists of a
9 Registers Memory: 4096x16 bits 4096 words of 16 bits memory unit
I(1 bit) S(1 bit) E(1 bit) R(1 bit) IEN(1 bit) FGI(1 bit) FGO(1 bit)
Adder and Logic circuit
ALU Nine registers : AR,
connected to the AC input
Control Logic Gates: 16 bits PC(12bits each), DR, AC,
IR, TR(16 bits each),
Signals to control the
Control Unit OUTR, INPR(8 bit each),
the nine registers’ inputs
and SC(4bits)
memory read and write Logic gates
Seven F/Fs : I, S, E, R,
F/Fs set, clear, or
3x8 DEC, 4x16 DEC IEN, FGI, and FGO (1 bit
complement
each)
S2 S1 S0 bus selection BUS: 8x1 MUX A 16-bit common bus
the AC ,ALU circuit
Two decoders: 3 x 8(opcode) 16 bits
and 4 x 16 timing decoder
IR and TR
Main Register M e m o r y u n it
4096× 16 A d d re s s
s0
7
AC, shift AC AR
1
LD IN R C LR
PC 2
Data Register : ADD LD IN R C LR
DR to AC, AND DR to D R
3
AC
LD IN R C LR
Adder E
and AC 4
lo g ic
LD IN R C LR
IR 5
LD
TR
6
LD IN R C LR
O U TR
C lo c k
LD
1 6 - b it c o m m o n b u s
Computer Instruction
3 Instruction Code Formats :
1-Register-reference instruction
–7xxx (7800 ~ 7001) :
CLA, CMA, ….
15 14 12 11 0
0 1 1 1 Register Operation
2-Input-Output instruction
–Fxxx(F800 ~ F040) : INP,
OUT, ION, SKI, ….
15 14 12 11 0
1 1 1 1 I/O Operation
3-Memory-reference instruction
Opcode = 000 110
I=0 : 0xxx ~ 6xxx, I=1: 8xxx
~Exxx
15 14 12 11 0
I=0 : Direct,
I=1 : Indirect I Opcode Address
CONTROL UNIT HARDWARE (Hardwired)
• Inputs to the control unit come from IR where an instruction is stored.
• A hardwired control is implemented in the example computer using:
> A 3x8 decoder to decode opcode bits 12-14 into signals D0, ..., D7;
Interrupt Cycle
Instruction cycle
Interrupts Enabled
Interrupts Disabled
Fetch,
Fetch,decode
decode Execute
Execute Interrupt
Interrupt
START
START Next
Next
Instruction Instruction
Instruction cycle
cycle
Instruction
HALT
HALT
Instruction Fetch
– Instruction Fetch : T0, T1
• T0 = 1
–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
T0 : AR PC Continue
indefinitely
T1 : IR M [ AR], PC PC 1 unless HALT
instruction is
encountered
– T1 = 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
Mano’s Computer Figure 5-4 s0 s1 s2
Bus
Memory Unit
7
4096x16
Address
WRITE READ
AR 1
LD INR CLR
PC 2
LD INR CLR
DR 3
LD INR CLR
Adder E
& Logic
AC 4
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
16-bit common bus
Computer System Architecture, Mano, Copyright (C) 1993 Prentice-Hall, Inc.
Instruction Cycle
At T3, microoperations which take place
depend on the type of instruction. The four
different paths are symbolized as follows,
D2T4: DR M[AR]
D2T5: AC DR, SC 0
Store AC
STA: Store AC.
D3T4: M[AR] AC, SC 0
BUN: Branch unconditionally. Transfers
the program to the instruction specified
by AR. (Note that the branch target
must be in AR beforehand.)
D4T4: PC AR, SC 0
Branch unconditionally
BUN: Branch unconditionally. Transfers
the program to the instruction specified
by AR. (Note that the branch target
must be in AR beforehand.)
D4T4: PC AR, SC 0
Branch and save return
address
This instructioin is useful for branching
to a position of the program called a
subprogram
D5T5: PC AR, SC 0
Increment and skip if zero
ISZ: Increment and skip if zero.
0 1 1 1 Register Operation
2-Input-Output instruction
–Fxxx(F800 ~ F040) : INP,
OUT, ION, SKI, ….
15 14 12 11 0
1 1 1 1 I/O Operation
3-Memory-reference instruction
Opcode = 000 110
I=0 : 0xxx ~ 6xxx, I=1: 8xxx
~Exxx
15 14 12 11 0
I=0 : Direct,
I=1 : Indirect I Opcode Address
Figure 5-11
Summary of memory-reference
instructions
5.7 IO and Interrupt
Input-Output Configuration :
1) Programmed I/O
F e tc h a n d d e c o d e
S to re re tu rn a d d re s s
in s tr u c t io n
in lo c a t io n 0
M [0] PC
=0
E x e c u te IE N
in s t r u c t io n
=1
B r a n c h t o lo c a t io n 1
PC 1
=1
F G I
=0
=1 IE N 0
F G O R 0
=0
R 1
Program Interrupt
Demonstration of the interrupt cycle :
The memory location at address 0 is the