COA Unit-1
COA Unit-1
CU
Input/Output Memory
ALU
Introduction To Computer Organization
And Architecture
Computer Architecture
The view of a computer as presented to software
designers
Computer Organization
The actual implementation of a computer in
hardware.
DIGITAL COMPUTERS
• The word digital implies that the information in the computer is represented by
variables that take a limited number of discrete values.
• The decimal digits 0, 1, 2, ..., 9, for example, provide 10 discrete values. The first
electronic digital computer, developed in the late 1940s, was used primarily for
numerical computations and the discrete elements were the digits. From this
application the term digital computer emerged.
• Digital computers function more reliably if only two states are used. Because of the
physical restriction of components, i.e. true or false, yes or no statements and are said
to be binary
• Digital computers use the binary number system, which has two digits: 0 and 1. A
binary digit is called a bit.
TYPES OF DIGITAL
COMPUTERS
Computer Organization
The symbolic notation used to describe the micro-operation transfer among registers is called RTL
(Register Transfer Language).
The use of symbols instead of a narrative explanation provides an organized and concise manner
for listing the micro-operation sequences in registers and the control functions that initiate them.
A register transfer language is a system for expressing in symbolic form the microoperation
sequences among the registers of a digital module.
It is a convenient tool for describing the internal organization of digital computers in concise and
precise manner.
Registers:
Computer registers are designated by upper case letters (and optionally followed by digits or
letters) to denote the function of the register.
For example, the register that holds an address for the memory unit is usually called a memory
address register and is designated by the name MAR.
Other designations for registers are PC (for program counter), IR (for instruction register, and R1
(for processor register).
The individual flip-flops in an n-bit register are numbered in sequence from 0 through n-1, starting
from 0 in the rightmost position and increasing the numbers toward the left.
Figure 4-1 shows the representation of registers in block diagram form.
The most common way to represent a register is by a rectangular box with the name of the
register inside, as in Fig. 4-1(a).
The individual bits can be distinguished as in (b).
The numbering of bits in a 16-bit register can be marked on top of the box as shown in (c).
16-bit register is partitioned into two parts in (d). Bits 0 through 7 are assigned the symbol L (for
low byte) and bits 8 through 15 are assigned the symbol H (for high byte).
The name of the 16-bit register is PC. The symbol PC (0-7) or PC (L) refers to the low-order byte
and PC (8-15) or PC (H) to the high-order byte.
Register Transfer:
Information transfer from one register to another is designated in symbolic form by means of a
replacement operator.
The statement R2← R1 denotes a transfer of the content of register R1 into register R2.
It designates a replacement of the content of R2 by the content of R1.
By definition, the content of the source register R 1 does not change after the transfer.
If we want the transfer to occur only under a predetermined control condition then it can be
shown by an if-then statement.
if (P=1) then R2← R1
P is the control signal generated by a control section.
We can separate the control variables from the register transfer operation by
specifying a Control Function.
Control function is a Boolean variable that is equal to 0 or 1.
control function is included in the statement as
P: R2← R1
Control condition is terminated by a colon implies transfer operation be
executed by the hardware only if P=1.
Every statement written in a register transfer notation implies a hardware
construction for implementing the transfer.
Figure 4-2 shows the block diagram that depicts the transfer from R1 to R2.
The multiplexers select the source register whose binary information is then placed
on the bus.
The construction of a bus system for four registers is shown in below Figure.
The bus consists of four 4 x 1 multiplexers each having four data inputs, 0 through 3, and two
selection inputs, S1 and S0.
For example, output 1 of register A is connected to input 0 of MUX 1 because this input is labelled
A1.
The diagram shows that the bits in the same significant position in each register are connected to
the data inputs of one multiplexer to form one line of the bus.
Thus MUX 0 multiplexes the four 0 bits of the registers, MUX 1 multiplexes the four 1 bits of the
registers, and similarly for the other two bits.
The two selection lines Si and So are connected to the selection inputs of all four multiplexers.
The selection lines choose the four bits of one register and transfer them into the four-line
common bus.
When S1S0 = 00, the 0 data inputs of all four multiplexers are selected and applied to the outputs
that form the bus.
This causes the bus lines to receive the content of register A since the outputs of this register are
connected to the 0 data inputs of the multiplexers.
Similarly, register B is selected if S1S0 = 01, and so on.
Table 4-2 shows the register that is selected by the bus for each of the four possible binary value
of the selection lines.
R1← C
It is distinguished from a normal buffer by having both a normal input and a control input.
The control input determines the output state. When the control input is equal to 1, the output is
enabled and the gate behaves like any conventional buffer, with the output equal to the normal
input.
When the control input is 0, the output is disabled and the gate goes to a high-impedance state,
regardless of the value in the normal input.
The construction of a bus system with three-state buffers is shown in Fig. 4
The outputs of four buffers are connected together to form a single bus line.
The control inputs to the buffers determine which of the four normal inputs will communicate with
the bus line.
No more than one buffer may be in the active state at any given time. The connected buffers
must be controlled so that only one three-state buffer has access to the bus line while all other
buffers are maintained in a high impedance state.
One way to ensure that no more than one control input is active at any given time is to use a
decoder, as shown in the diagram.
When the enable input of the decoder is 0, all of its four outputs are 0, and the bus line is in a
high-impedance state because all four buffers are disabled.
When the enable input is active, one of the three-state buffers will be active, depending on the
binary value in the select inputs of the decoder.
Memory Transfer:
The transfer of information from a memory word to the outside environment is called a read
operation.
The transfer of new information to be stored into the memory is called a write operation.
A memory word will be symbolized by the letter M.
The particular memory word among the many available is selected by the memory address during
the transfer.
It is necessary to specify the address of M when writing memory transfer operations.
This will be done by enclosing the address in square brackets following the letter M.
Consider a memory unit that receives the address from a register, called the address register,
symbolized by AR.
The data are transferred to another register, called the data register, symbolized by DR.
The read operation can be stated as follows:
This causes a transfer of information into DR from the memory word M selected by the address in
AR.
The write operation transfers the content of a data register to a memory word M selected by the
address. Assume that the input data are in register R1 and the address is in AR.
The write operation can be stated as follows:
Write: M [AR] <- R1
Types of Micro-operations:
Register Transfer Micro-operations: Transfer binary information from one register to another.
Arithmetic Micro-operations: Perform arithmetic operation on numeric data stored in registers.
Logical Micro-operations: Perform bit manipulation operations on data stored in registers.
Shift Micro-operations: Perform shift operations on data stored in registers.
Register Transfer Micro-operation doesn’t change the information content when the binary
information moves from source register to destination register.
Micro-operations
• Simple digital systems are frequently characterized in terms of
– the registers they contain, and
– the operations that they perform.
• The operations on the data in registers are called micro-
operations.
• The functions built into registers are examples of micro-
operations
– Shift
– Load
– Clear
– Increment ...etc.
- Arithmetic micro-operations
- Logic micro-operations
- Shift micro-operations
- Register transfer micro-operations
1
4 X1 Fi
MUX
2
3 Select
S1
S0
Function table
S1 S0 Output -operation
0 0 F=AB AND
0 1 F=AB OR
1 0 F=AB XOR
1 1 F = A’ Complement
sign
bit
0
sign
bit
o Computer Registers
o Computer Instructions
o Instruction Cycle
Sunday, April 4
21, 2019 4
Instruction Codes…
o Instruction format:
o Two major components of an instruction code:
o The operation code (opcode)
o Address
o An opcode specifies the operation for the instruction.
o An address specifies the registers and/or locations
in memory to use for that operation
15 14 12 11 0
I Opcode Address
Addressing
mode Fig: Instruction Format
Sunday, April 4
21, 2019 5
Instruction Codes…
o Address Mode:
o The address field of an instruction represents
o Direct address: the address in memory of the data to use
(the address of the operand)
o Indirect address: the address in memory of the address
in memory of the data to use
Sunday, April 4
21, 2019 6
Basic Computer Registers
Sunday, April 4
21, 2019 7
Basic Computer Registers…
Fig: Registers
Connected to
Common Bus
Sunday, April 4
21, 2019 8
Computer Instructions
o The basic computer has three instruction code
formats:
Sunday, April 4
21, 2019 9
Computer Instructions…
Sunday, April 5
21, 2019 0
Computer Instructions…
o Instruction Types:
o Functional Instructions
o Arithmetic, logic, and shift instructions
o ADD, CMA, INC, CIR, CIL, AND, CLA
o Transfer Instructions
o Data transfers between the main memory and the
processor registers
o LDA, STA
o Control Instructions
o Program sequencing and control
o BUN, BSA, ISZ
o Input/Output Instructions
o Input and output
o INP, OUT
Sunday, April 5
21, 2019 1
Timing and Control
o Control Unit:
o Control units are implemented in one of two
ways:
o Hardwired Control
o CU is made up of sequential and combinational
circuits to generate the control signals
o Microprogrammed Control
o A control memory on the processor contains
microprograms that activate the necessary control
signals
Sunday, April 5
21, 2019 2
Timing and Control…
Sunday, April 5
21, 2019 3
Timing and Control…
o Timing Signal:
o Example: T0, T1, T2, T3, T4, T0, T1, . . .
Assume: At time T4, SC is cleared to 0 if decoder
output D3 is active. D3T4: SC 0
T0 T1 T2 T3 T4 T0
Cloc k
T0
T1
T2
T3
T4
D3
CLR
SC
Sunday, April 5
21, 2019 4
Instruction Cycle
o In the basic computer each instruction cycle
consists:
i. Fetch an instruction from memory
ii. Decode the instruction
iii. Read the effective address from memory if the
instruction has an indirect address.
iv. Execute the instruction.
Sunday, April 5
21, 2019 5
Instruction Cycle…
o Fetch and Decode
T0: AR PC (S0S1S2=010, T0=1)
T1: IR M [AR], PC PC + 1 (S0S1S2=111, T1=1)
T2: D0, . . . , D7 Decode IR(12-14),AR IR(0-11), I IR(15)
Sunday, April 5
21, 2019 6
Instruction Cycle…
o Determine the Type of Instruction
D'7IT3: AR M[AR]
D'7I'T3: Nothing
D7I'T3: Execute a register-reference instr.
D7IT3: Execute an input-output instr.
Sunday, April 5
21, 2019 7
Memory Reference Instruction
Operation
Symbol Decoder Symbolic Description
AND D0 AC AC M[AR]
ADD D1 AC AC + M[AR], E Cout
LDA D2 AC M[AR]
STA D3 M[AR] AC
BUN D4 PC AR
BSA D5 M[AR] PC, PC AR + 1
ISZ D6 M[AR] M[AR] + 1, if M[AR] + 1 = 0 then PC PC+1
AND to AC
D0T4: DR M[AR] Read operand
D0T5: AC AC DR, SC 0 AND with AC
ADD to AC
D1T4: DR M[AR] Read operand
D1T5: AC AC + DR, E Cout, SC 0 Add toAC and store carry in E
Sunday, April 5
21, 2019 8
o Memory Reference Instruction…
LDA: Load to AC
D2T4: DR M[AR]
D2T5: AC DR, SC 0
STA: Store AC
D3T4: M[AR] AC, SC 0
BUN: Branch Unconditionally
D4T4: PC AR, SC 0
BSA: Branch and Save Return Address
M[AR] PC, PC AR + 1
D5T4: M[AR] PC, AR AR + 1
D5T5: PC AR, SC 0
ISZ: Increment and Skip-if-Zero
D6T4: DR M[AR]
D6T5: DR DR + 1
D6T4: M[AR] DR, if (DR = 0) then (PC PC + 1), SC 0
Sunday, April 5
21, 2019 9
o Flowchart For Memory Reference Instructions
Sunday, April 6
21, 2019 0
Input-output and Interrupt
o Input and output instructions are needed for
transferring information to and from AC
register.
o for checking the flag bits, and
o for controlling the interrupt facility.
o Note: Input-output instructions have an
operation code 1111 and are recognized by the
control when D7 = 1 and I = 1.
Sunday, April 6
21, 2019 1
Input-Output and Interrupts…
o Input-Output Instructions…
D7IT3 = p
IR(i) = Bi, i = 6, …, 11
p: SC 0 Clear SC
INP pB11: AC(0-7) INPR, FGI 0 Input char. toAC
OUT pB10: OUTR AC(0-7), FGO 0 Output char. fromAC
SKI pB9: if(FGI = 1) then (PC PC + 1) Skip on input flag
SKO pB8: if(FGO = 1) then (PC PC + 1) Skip on output flag
ION pB7: IEN 1 Interrupt enable on
IOF pB6: IEN 0 Interrupt enable off
Sunday, April 6
21, 2019 3
Input-Output and Interrupts…
o Flowchart for Interrupt Cycle
Sunday, April 6
21, 2019 4