SlideShare a Scribd company logo
1 of 83
Download to read offline
COMPUTER ORGANIZATION
AND ARCHITECTURE
Dr V. Jayavani
Assistant Professor
Dept. of CSE, GST
Visakhapatnam
jvankara2@gitam.edu
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
UNIT II: Basic Computer
Organization and Design
• Instruction codes
• computer registers
• computer instructions
• timing and control
• instruction cycle
• memory-references instructions
• input-output and interrupt
• complete computer description
• Design of the basic computer, design of accumulator logic.
• Micro programmed Control: Control memory, address sequencing, micro
program example,
• design of control unit.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction codes
• The organization of the computer is defined by its internal registers, the timing and
control structure, and the set of instructions that it uses.
• Internal organization of a computer is defined by the sequence of micro-operations it
performs on data stored in its registers.
• Computer can be instructed about the specific sequence of operations it must
perform. User controls this process by means of a Program.
• Program: set of instructions that specify the operations, operands, and the sequence
by which processing has to occur.
• Instruction: a binary code that specifies a sequence of micro-operations for the
computer.
• The computer reads each instruction from memory and places it in a control register.
The control then interprets the binary code of the instruction and proceeds to execute
it by issuing a sequence of micro-operations.
• Every computer has its own unique instruction set. The ability to store and execute
instructions and stored program concept is the most important property of a general
purpose computer.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction codes
• Instruction Code: group of bits that instruct the computer to perform specific
operation.
• Instruction code is usually divided into two parts: Opcode and address(operand)
Operation Code (opcode):
• group of bits that define the operation. Eg: add, subtract, multiply, shift,
complement.
• No. of bits required for opcode depends on total no. of operations available in
computer.
• The operation code must consist of at least n-bits for a given 2n (or less) distinct
operations.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction codes
Operation Code (opcode):
• The control unit receives the instruction from memory and interprets the operation
code bits. It then issues a sequence of control signals to initiate microoperations in
internal computer registers.
• For this reason, an operation code is sometimes called a macrooperation because it
specifies a set of microoperations.
Address (operand):
• specifies the location of operands (registers or memory words)
• Memory words are specified by their address
• Registers are specified by their k-bit binary code that specify one of 2k registers.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Stored Program Organization
• The simplest way to organize a computer is to have one
processor register and an instruction code format with two
parts.
• The first part specifies the operation to be performed and
the second specifies an address. The memory address tells
the control where to find an operand in memory.
• This operand is read from memory and used as the data to be
operated on together with the data stored in the processor
register.
• The ability to store and execute instructions is the most
important property of a general-purpose computer. That type
of stored program concept is called stored program
organization.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Stored Program Organization
• Instructions are stored in one section of memory and data in
another.
• For a memory unit with 4096 words we need 12 bits to
specify an address since 212 = 4096.
• If we store each instruction code in one 16-bit memory word,
we have available four bits for the operation code
(abbreviated opcode) to specify one out of 16 possible
operations, and 12 bits to specify the address of an operand.
• Accumulator (AC): Computers that have a single-processor
register usually assign to it the name accumulator and label
it AC.
• The operation is performed with the memory operand and
the content of AC.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Stored Program Organization
Addressing of Operand:
• Sometimes convenient to use the address bits of an instruction code not as an
address but as the actual operand.
• When the second part of an instruction code specifies an operand, the instruction
is said to have an immediate operand.
• When the second part specifies the address of an operand, the instruction is said
to have a direct address.
• When second part of the instruction designate an address of a memory word in
which the address of the operand is found such instruction have indirect address.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Stored Program Organization
Addressing of Operand:
• One bit of the instruction code can be used to
distinguish between a direct and an indirect
address.
• It consists of a 3-bit operation code, a 12-bit
address, and an indirect address mode bit
designated by I.
• The mode bit is 0 for a direct address and 1 for
an indirect address.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Direct addressing
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Indirect addressing
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Problem
A computer uses a memory unit with 256Kwords of 32 bits each. A binary
instruction code is stored in one word of memory. The instruction has four
parts: an indirect bit. an operation code, a register code part to specify one of
64 registers, and an address part.
a. How many bits are there in the operation code, the register code part, and
the address part?
b. Draw the instruction word format and indicate the number of bits in each
part.
c. How many bits are there in the data and address inputs of the memory?
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Problem
A computer uses a memory unit with
256Kwords of 32 bits each. A binary
instruction code is stored in one word of
memory. The instruction has four parts: an
indirect bit. an operation code, a register
code part to specify one of 64 registers, and
an address part.
a. How many bits are there in the operation
code, the register code part, and the address
part?
b. Draw the instruction word format and
indicate the number of bits in each part.
c. How many bits are there in the data and
address inputs of the memory?
Solution:
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Registers
• Computer instructions are normally stored in
consecutive memory locations and are executed
sequentially one at a time.
• The control reads an instruction from a specific
address in memory and executes it.
• It then continues by reading the next instruction in
sequence and executes it, and so on.
Need of the registers in computer:
• Instruction sequencing needs a counter to calculate
the address of the next instruction after execution of
the current instruction is completed (PC).
• Necessary to provide a register in the control unit for
storing the instruction code after it is read from
memory (IR).
• Needs processor registers for manipulating data (AC
and TR) and a register for holding a memory address
(AR).
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Registers
• The memory unit has a capacity of 4096 words and
each word contains 16 bits.
• Twelve bits of an instruction word are needed to
specify the address of an operand.
• This leaves three bits for the operation part of the
instruction and a bit to specify a direct or indirect
address.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Registers
• The data register (DR) holds the operand read from
memory.
• The accumulator (AC) register is a general purpose
processing register.
• The instruction read from memory is placed in the
instruction register (IR).
• The temporary register (TR) is used for holding
temporary data during the processing.
• The memory address register (AR) has 12 bits since
this is the width of a memory address.
• The program counter (PC) also has 12 bits and it holds
the address of the next instruction to be read from
memory after the current instruction is executed.
• Two registers are used for input and output.
• The input register (INPR) receives an 8-bit
character from an input device.
• The output register (OUTR) holds an 8-bit
character for an output device.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Common Bus System
• The basic computer has eight registers, a memory
unit, and a control unit.
• Paths must be provided to transfer information
from one register to another and between memory
and registers.
• A more efficient scheme for transferring
information in a system with many registers is to
use a common bus.
• The connection of the registers and memory of the
basic computer to a common bus system is shown
in Fig.
• The outputs of seven registers and memory are
connected to the common bus.
• The input data and output data of the memory are
connected to the common bus, but the memory
address is connected to AR.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Common Bus System
• The specific output that is selected for the bus lines
at any given time is determined from the binary value
of the selection variables S2, S1, and S0.
• The number along each output shows the decimal
equivalent of the required binary selection. For
example, the number along the output of DR is 3. The
16-bit outputs of DR are placed on the bus lines when
S2S1S0 = 011.
• The lines from the common bus are connected to the
inputs of each register and the data inputs of the
memory.
• The particular register whose LD (load) input is
enabled receives the data from the bus during the
next clock pulse transition.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Common Bus System
• The memory receives the contents of the bus
when its write input is activated.
• The memory places its 16-bit output onto the
bus when the read input is activated and
S2S1S0 = 111.
• Five registers have three control inputs: LD
(load), INR (increment), and CLR (clear).
• This type of register is equivalent to a binary
counter with parallel load and synchronous
clear.
• Two registers have only a LD input. (IR, OUTR)
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Common Bus System
• The 16 inputs of AC come from an adder and
logic circuit. This circuit has three sets of
inputs.
• One set of 16-bit inputs come from the outputs
of AC.
• Another set of 16-bit inputs come from the data
register DR. The result of an addition is
transferred to AC and the end carry-out of the
addition is transferred to flip-flop E (extended
AC bit).
• A third set of 8-bit inputs come from the input
register INPR.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Instructions
• A memory-reference instruction uses 12 bits to specify
an address and one bit to specify the addressing mode
I. I is equal to 0 for direct address and to 1 for indirect
address.
• An input—output instruction does not need a reference to
memory and is recognized by the operation code 111 with a 1
in the leftmost bit of the instruction. The remaining 12 bits
are used to specify the type of input—output operation.
• The register-reference instructions are recognized by the
operation code 111 with a 0 in the leftmost bit (bit 15) of the
instruction.
• A register-reference instruction specifies an operation on the
AC register. So an operand from memory is not needed.
Therefore, the other 12 bits are used to specify the operation
to be executed.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Memory-Reference
Instructions
• Opcode = 000 ∼ 110
• I=0 : 0xxx ~ 6xxx, I=1: 8xxx ~Exxx
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Register-Reference
Instructions
• Opcode = 111
• 7xxx (7800 ~ 7001) : CLA, CMA, ….
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Input – Output
Instructions
• Opcode = 000 ∼ 110
• I=0 : 0xxx ~ 6xxx, I=1: 8xxx ~Exxx
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction set completeness
• A computer should have a set of instructions so that the user can construct
machine language programs to evaluate any function that is known to be
computable.
• The set of instructions are said to be complete if the computer includes a
sufficient number of instructions in each of the following categories.
1. Arithmetic, logical and shift instructions
2. Instructions for moving information to and from memory and processor
register
3. Program control instructions together with instructions that check status
conditions
4. Input and output instructions
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction set completeness
• Arithmetic, logical, and shift instructions provide computational capabilities for
processing the type of data that the user may wish to employ.
• The bulk of the binary information in a digital computer is stored in memory, but
all computations are done in processor registers. Therefore, the user must have
the capability of moving information between these two units.
• Decision making capabilities are an important aspect of digital computers. Program
control instructions such as branch instructions are used to change the sequence in
which the program is executed.
• Input and output instructions are needed for communication between the
computer and the user. Programs and data must be transferred into memory and
results of computations must be transferred back to the user.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction set completeness
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction set completeness
• There is one arithmetic instruction, ADD, and two related instructions,
complement AC (CMA) and increment AC (INC). With these three instructions we
can add and subtract binary numbers when negative numbers are in signed-2s
complement representation.
• The circulate instructions, CIR and CIL, can be used for arithmetic shifts as well as
any other type of shifts desired
• Multiplication and division can be performed using addition, subtraction, and clear
AC (CLA). The AND and complement provide a NAND operation.
• Moving information from memory to AC is accomplished with the load AC (LDA)
instruction. Storing information from AC into memory is done with the store.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Timing and Control
• The timing for all registers in the basic computer is controlled by a master clock
generator.
• The clock pulses are applied to all flip-flops and registers in the system, including
the flip-flops and registers in the control unit.
• The clock pulses do not change the state of a register unless the register is
enabled by a control signal.
• The control signals are generated in the control unit and provide control inputs for
the multiplexers in the common bus, control inputs in processor registers, and
microoperations for the accumulator.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Control Unit
• There are two major types of control organization, hardwired control and
microprogrammed control.
• In the hardwired organization, the control logic is implemented with gates, flip-
flops, decoders, and other digital circuits. It has the advantage that it can be
optimized to produce a fast mode of operation.
• In the microprogrammed organization, the control information is stored in a
control memory. The control memory is programmed to initiate the required
sequence of microoperations.
• A hardwired control requires changes in the wiring among the various components
if the design has to be modified or changed.
• In the microprogrammed control, any required changes or modifications can be
done by updating the microprogram in control memory.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Timing and Control
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Timing and Signals
• Generated by 4-bit sequence
counter and 416 decoder
• The SC can be incremented
or cleared.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Instruction Cycle
• A program residing in the memory unit of the computer consists of a sequence of
instructions.
• The program is executed in the computer by going through a cycle for each instruction. Each
instruction cycle in turn is subdivided into a sequence of subcycles or phases.
• In the basic computer each instruction cycle consists of the following phases:
• 1. Fetch an instruction from memory.
• 2. Decode the instruction.
• 3. Read the effective address from memory if the instruction has an indirect address.
• 4. Execute the instruction.
• Upon the completion of step 4, the control goes back to step 1 to fetch, decode, and
execute the next instruction.
• This process continues indefinitely unless a HALT instruction is encountered.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Fetch and Decode
• Initially, the program counter PC is loaded with the address of the first instruction in the
program.
• The sequence counter SC is cleared to 0, providing a decoded timing signal T0.
• After each clock pulse, SC is incremented by one, so that the timing signals go through a
sequence T 0 , T i, T 2 , and so on.
• The microoperations for the fetch and decode phases can be specified by the following
register transfer statements.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Register transfer for
Fetch Phase
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Determine the type of
Instruction Flowchart for Instruction cycle
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Register-Reference Instructions
• Register Reference Instructions are identified when
- D7 = 1, I = 0
- Register Ref. Instr. is specified in b0 ~ b11 of IR
- Execution starts with timing signal T3
r = D7 I’T3 => Register Ref Instruction
Bi = IR(i) , i=0,1,2,...,11
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Memory Reference Instructions
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Memory Reference Instructions
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 to AC and store carry in E
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
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Memory Reference Instructions
BSA: Branch and Save Return Address
D5T4: M[AR]  PC, AR  AR + 1
D5T5: PC  AR, SC  0
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Memory Reference Instructions
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
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Memory Reference Instructions
Flowchart
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
INPUT-OUTPUT and INTERRUPT
• A computer can serve no useful purpose unless it communicates with the external
environment.
• Instructions and data stored in memory must come from some input device.
• Computational results must be transmitted to the user through some output device.
• Commercial computers include many types of input and output devices.
• To demonstrate the most basic requirements for input and output communication, we
will use as an illustration a terminal unit with a keyboard and printer.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
INPUT-OUTPUT Configuration
• The terminal sends and receives serial information.
Each quantity of information has eight bits of an
alphanumeric code.
• The serial information from the keyboard is shifted
into the input register INPR.
• The serial information for the printer is stored in the
output register OUTR.
• INPR and OUTR registers communicate with a
communication interface serially and with the AC in
parallel. The input-output configuration is shown in
Figure.
• The flags are needed to synchronize the timing
difference between I/O device and the computer
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
INPUT-OUTPUT Configuration
• The flag bit (FGI) is set to 1 when new
information is available in the input device
and is cleared to 0 when the information is
accepted by the computer.
• The computer checks the flag bit (FGO); if
it is 1, the information from AC is
transferred in parallel to OUTR and FGO is
cleared to 0.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
INPUT-OUTPUT Instructions
p: SC  0 Clear SC
INP pB11: AC(0-7)  INPR, FGI  0 Input char. to AC
OUT pB10: OUTR  AC(0-7), FGO  0 Output char. from AC
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
D7 =1, I=1
D7IT3 = p
IR(i) = Bi, i = 6, …, 11
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Communication with I/O
Two ways  1) Programmed I/O
2) Interrupt I/O
• Programmed I/O:
BACK: SKI
BUN BACK
INP
• Input-output device can transfer information at a maximum rate of 10 characters per
second.  equivalent to one character every 100,000 uS.
• Two instructions are executed when the computer checks the flag bit and decides not to
transfer the information.
• This means that at the maximum rate, the computer will check the flag 50,000 times
between each transfer.
• The computer is wasting time while checking the flag instead of doing some other useful
processing task.
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Program Interrupt
• Open communication only when some data has to be passed --> interrupt.
• The I/O interface, instead of the CPU, monitors the I/O device.
• When the interface founds that the I/O device is ready for data transfer, it
generates an interrupt request to the CPU
• Upon detecting an interrupt, the CPU stops momentarily the task
• it is doing, branches to the service routine to process the data transfer, and
then returns to the task it was performing.
• IEN (Interrupt-enable flip-flop)
• can be set and cleared by instructions
• when cleared, the computer cannot be interrupted
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Flowchart for Interrupt Cycle
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Interrupt Cycle
26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Complete Computer Description
Complete Computer Description
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Control Logic functions
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Control of Registers and Memory
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Control of Common Bus
26 December 2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Design of Accumulator Logic
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Control of AC Register
Gate Structure for controlling LD,INR and CLR of AC
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
One stage of adder and logic circuit
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Control Unit Implementation
• Hardwired
• Microprogrammed
Instruction code
Combinational
Logic Circuits
Memory
Sequence Counter
.
.
Control
signals
Control
signals
Next Address
Generator
(sequencer)
CAR Control
Memory
CDR Decoding
Circuit
Memory
.
.
CAR: Control Address Register
CDR: Control Data Register
Instruction code
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogrammed Control Unit
 Control signals
 Group of bits used to select paths in multiplexers,
decoders, arithmetic logic units
 Control variables
 Binary variables specify microoperations
 Certain microoperations initiated while others idle
 Control word
 String of 1’s and 0’s represent control variables
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogrammed Control Unit
 Control memory
 Memory contains control words
 Microinstructions
 Control words stored in control memory
 Specify control signals for execution of microoperations
 Microprogram
 Sequence of microinstructions
26 December
2023
Control Memory
 Read-only memory (ROM)
 Content of word in ROM at given address specifies microinstruction
 Each computer instruction initiates series of microinstructions
(microprogram) in control memory
 These microinstructions generate microoperations to
 Fetch instruction from main memory
 Evaluate effective address
 Execute operation specified by instruction
 Return control to fetch phase for next instruction
Control
memory
(ROM)
Control word
(microinstruction)
Address
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
 Control memory
 Contains microprograms (set of microinstructions)
 Microinstruction contains
 Bits initiate microoperations
 Bits determine address of next microinstruction
 Control address register (CAR)
 Specifies address of next microinstruction
Microprogrammed Control Organization
Control
word
Next Address
Generator
(sequencer)
CAR
Control
Memory
(ROM)
CDR
External
input
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogrammed Control Organization
 Next address generator (microprogram sequencer)
 Determines address sequence for control memory
 Microprogram sequencer functions
 Increment CAR by one
 Transfer external address into CAR
 Load initial address into CAR to start control operations
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogrammed Control Organization
 Control data register (CDR)- or pipeline register
 Holds microinstruction read from control memory
 Allows execution of microoperations specified by control word
simultaneously with generation of next microinstruction
 Control unit can operate without CDR
Control
word
Next Address
Generator
(sequencer)
CAR
Control
Memory
(ROM)
External
input
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogram Routines
 Routine
 Group of microinstructions stored in control memory
 Each computer instruction has its own microprogram routine to generate microoperations that
execute the instruction
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogram Routines
 Subroutine
 Sequence of microinstructions used by other routines
to accomplish particular task
 Example
 Subroutine to generate effective address of operand
for memory reference instruction
 Subroutine register (SBR)
 Stores return address during subroutine call
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Conditional Branching
 Branching from one routine to another depends on status
bit conditions
 Status bits provide parameter info such as
 Carry-out of adder
 Sign bit of number
 Mode bits of instruction
 Info in status bits can be tested and actions initiated based
on their conditions: 1 or 0
 Unconditional branch
 Fix value of status bit to 1
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Mapping of Instruction
 Each computer instruction has its own microprogram routine stored in a given
location of the control memory
 Mapping
 Transformation from instruction code bits to address in control memory where
routine is located
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Mapping of Instruction
 Example
 Mapping 4-bit operation code to 7-bit address
OP-codes of Instructions
ADD
AND
LDA
0000
0001
0010
Address
0 0000 00
0 0001 00
0 0010 00
Mapping bits 0 xxxx 00
ADD Routine
AND Routine
LDA Routine
Control
memory
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Address Sequencing
 Address sequencing capabilities required in control unit
 Incrementing CAR
 Unconditional or conditional branch, depending on status bit conditions
 Mapping from bits of instruction to address for control memory
 Facility for subroutine call and return
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Address Sequencing
Instruction code
Mapping
logic
Multiplexers
Control memory (ROM)
Subroutine
Register
(SBR)
Branch
logic
Status
bits
Microoperations
Control Address Register
(CAR)
Incrementer
MUX
select
select a status
bit
Branch address
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogram Example
Computer
Configuration
MUX
AR
10 0
PC
10 0
Address Memory
2048 x 16
MUX
DR
15 0
Arithmetic
logic and
shift unit
AC
15 0
SBR
6 0
CAR
6 0
Control memory
128 x 20
Control unit
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microprogram Example
Microinstruction Format
EA is the effective address
Symbol OP-code Description
ADD 0000 AC  AC + M[EA]
BRANCH 0001 if (AC < 0) then (PC  EA)
STORE 0010 M[EA]  AC
EXCHANGE 0011 AC  M[EA], M[EA]  AC
Computer instruction format
I Opcode
15 14 11 10
Address
0
Four computer instructions
F1 F2 F3 CD BR AD
3 3 3 2 2 7
F1, F2, F3: Microoperation fields
CD: Condition for branching
BR: Branch field
AD: Address field
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
Microinstruction Fields
F1 Microoperation Symbol
000 None NOP
001 AC  AC + DR ADD
010 AC  0 CLRAC
011 AC  AC + 1 INCAC
100 AC  DR DRTAC
101 AR  DR(0-10) DRTAR
110 AR  PC PCTAR
111 M[AR]  DR WRITE
F2 Microoperation Symbol
000 None NOP
001 AC  AC - DR SUB
010 AC  AC  DR OR
011 AC  AC  DR AND
100 DR  M[AR] READ
101 DR  AC ACTDR
110 DR  DR + 1 INCDR
111 DR(0-10)  PC PCTDR
F3 Microoperation Symbol
000 None NOP
001 AC  AC  DR XOR
010 AC  AC’ COM
011 AC  shl AC SHL
100 AC  shr AC SHR
101 PC  PC + 1 INCPC
110 PC  AR ARTPC
111 Reserved
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Microinstruction Fields
CD Condition Symbol Comments
00 Always = 1 U Unconditional branch
01 DR(15) I Indirect address bit
10 AC(15) S Sign bit of AC
11 AC = 0 Z Zero value in AC
BR Symbol Function
00 JMP CAR  AD if condition = 1
CAR  CAR + 1 if condition = 0
01 CALL CAR  AD, SBR  CAR + 1 if condition = 1
CAR  CAR + 1 if condition = 0
10 RET CAR  SBR (Return from subroutine)
11 MAP CAR(2-5)  DR(11-14), CAR(0,1,6)  0
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Symbolic Microinstruction
 Sample Format Label: Micro-ops CD BR AD
 Label may be empty or may specify symbolic address
terminated with colon
 Micro-ops consists of 1, 2, or 3 symbols separated by commas
 CD one of {U, I, S, Z}
U: Unconditional Branch
I: Indirect address bit
S: Sign of AC
Z: Zero value in AC
 BR one of {JMP, CALL, RET, MAP}
 AD one of {Symbolic address, NEXT, empty}
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Fetch Routine
 Fetch routine
- Read instruction from memory
- Decode instruction and update PC
AR  PC
DR  M[AR], PC  PC + 1
AR  DR(0-10), CAR(2-5)  DR(11-14), CAR(0,1,6)  0
Symbolic microprogram for fetch routine:
ORG 64
PCTAR U JMP NEXT
READ, INCPC U JMP NEXT
DRTAR U MAP
FETCH:
Binary microporgram for fetch routine:
1000000 110 000 000 00 00 1000001
1000001 000 100 101 00 00 1000010
1000010 101 000 000 00 11 0000000
Binary
address F1 F2 F3 CD BR AD
Microinstructions for fetch routine:
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Symbolic Microprogram
• Control memory: 128 20-bit words
• First 64 words: Routines for 16 machine instructions
• Last 64 words: Used for other purpose (e.g., fetch routine and other subroutines)
• Mapping: OP-code XXXX into 0XXXX00, first address for 16 routines are
0(0 0000 00), 4(0 0001 00), 8, 12, 16, 20, ..., 60
ORG 0
NOP
READ
ADD
ORG 4
NOP
NOP
NOP
ARTPC
ORG 8
NOP
ACTDR
WRITE
ORG 12
NOP
READ
ACTDR, DRTAC
WRITE
ORG 64
PCTAR
READ, INCPC
DRTAR
READ
DRTAR
I
U
U
S
U
I
U
I
U
U
I
U
U
U
U
U
U
U
U
CALL
JMP
JMP
JMP
JMP
CALL
JMP
CALL
JMP
JMP
CALL
JMP
JMP
JMP
JMP
JMP
MAP
JMP
RET
INDRCT
NEXT
FETCH
OVER
FETCH
INDRCT
FETCH
INDRCT
NEXT
FETCH
INDRCT
NEXT
NEXT
FETCH
NEXT
NEXT
NEXT
ADD:
BRANCH:
OVER:
STORE:
EXCHANGE:
FETCH:
INDRCT:
Label Microops CD BR AD
Partial Symbolic Microprogram
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Binary Microprogram
Address Binary Microinstruction
Micro Routine Decimal Binary F1 F2 F3 CD BR AD
ADD 0 0000000 000 000 000 01 01 1000011
1 0000001 000 100 000 00 00 0000010
2 0000010 001 000 000 00 00 1000000
3 0000011 000 000 000 00 00 1000000
BRANCH 4 0000100 000 000 000 10 00 0000110
5 0000101 000 000 000 00 00 1000000
6 0000110 000 000 000 01 01 1000011
7 0000111 000 000 110 00 00 1000000
STORE 8 0001000 000 000 000 01 01 1000011
9 0001001 000 101 000 00 00 0001010
10 0001010 111 000 000 00 00 1000000
11 0001011 000 000 000 00 00 1000000
EXCHANGE 12 0001100 000 000 000 01 01 1000011
13 0001101 001 000 000 00 00 0001110
14 0001110 100 101 000 00 00 0001111
15 0001111 111 000 000 00 00 1000000
FETCH 64 1000000 110 000 000 00 00 1000001
65 1000001 000 100 101 00 00 1000010
66 1000010 101 000 000 00 11 0000000
INDRCT 67 1000011 000 100 000 00 00 1000100
68 1000100 101 000 000 00 10 0000000
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Design of Control Unit
microoperation fields
3 x 8 decoder
7 6 5 4 3 2 1 0
F1
3 x 8 decoder
7 6 5 4 3 2 1 0
F2
3 x 8 decoder
7 6 5 4 3 2 1 0
F3
Arithmetic
logic and
shift unit
AND
ADD
DRTAC
AC
Load
From
PC
From
DR(0-10)
Select 0 1
Multiplexers
AR
Load Clock
AC
DR
DRTAR
PCTAR
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Microprogram Sequencer
3 2 1 0
S1 MUX1
External
(MAP)
SBR
Load
Incrementer
CAR
Input
logic
I0
T
MUX2
Select
1
I
S
Z
Test
Clock
Control memory
Microops CD BR AD
L
I1
S0
. . .
. . .
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE
Input Logic for Microprogram Sequencer
Input
logic
I0
I1
T
MUX2
Select
1
I
S
Z
Test
CD Field of CS
From
CPU BR field
of CS
L(load SBR with PC) for
subroutine Call
S0
S1
for next address
selection
I1I0T Meaning Source of Address S1S0 L
000 In-Line CAR+1 00 0
001 JMP CS(AD) 01 0
010 In-Line CAR+1 00 0
011 CALL CS(AD) and SBR <- CAR+1 01 1
10x RET SBR 10 0
11x MAP DR(11-14) 11 0
L
S1 = I1
S0 = I0I1 + I1’T
L = I1’I0T
Input Logic
26 December
2023
Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND
ARCHITECTURE

More Related Content

Similar to Computer org Architecture module2 ppt.pdf

16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)Susam Pal
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2parthivrathodlits
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationSmit Luvani
 
Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)myanddy
 
Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)myanddy
 
It5304 syllabus
It5304 syllabusIt5304 syllabus
It5304 syllabusnimal83
 
Assignment#1 Mapacpac, F M P (Cs3112 Os)
Assignment#1 Mapacpac, F M P  (Cs3112 Os)Assignment#1 Mapacpac, F M P  (Cs3112 Os)
Assignment#1 Mapacpac, F M P (Cs3112 Os)dyandmy
 
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptxUnit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptxIronMan665214
 
embedded system and computer architecure
embedded system and computer architecureembedded system and computer architecure
embedded system and computer architecuremadhulbtech23
 
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORSA REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORSIRJET Journal
 
Design of control unit.pptx
Design of control unit.pptxDesign of control unit.pptx
Design of control unit.pptxShubham014
 
Pai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadPai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadYogesh Deshpande
 
Computer Organization & Architecture (COA)Unit 4
Computer Organization & Architecture (COA)Unit 4Computer Organization & Architecture (COA)Unit 4
Computer Organization & Architecture (COA)Unit 4parthivrathodlits
 

Similar to Computer org Architecture module2 ppt.pdf (20)

COA.pptx
COA.pptxCOA.pptx
COA.pptx
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2
 
Co question 2006
Co question 2006Co question 2006
Co question 2006
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and Organization
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
CSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptxCSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptx
 
Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)
 
Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)Assignment#1 lograbo, s.f. (cs3112-os)
Assignment#1 lograbo, s.f. (cs3112-os)
 
Unit I.pptx
Unit I.pptxUnit I.pptx
Unit I.pptx
 
It5304 syllabus
It5304 syllabusIt5304 syllabus
It5304 syllabus
 
U I - 4. 80386 Real mode.pptx
U I - 4. 80386 Real mode.pptxU I - 4. 80386 Real mode.pptx
U I - 4. 80386 Real mode.pptx
 
Assignment#1 Mapacpac, F M P (Cs3112 Os)
Assignment#1 Mapacpac, F M P  (Cs3112 Os)Assignment#1 Mapacpac, F M P  (Cs3112 Os)
Assignment#1 Mapacpac, F M P (Cs3112 Os)
 
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptxUnit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
 
embedded system and computer architecure
embedded system and computer architecureembedded system and computer architecure
embedded system and computer architecure
 
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORSA REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
 
Design of control unit.pptx
Design of control unit.pptxDesign of control unit.pptx
Design of control unit.pptx
 
Pai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadPai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_upload
 
Computer Organization & Architecture (COA)Unit 4
Computer Organization & Architecture (COA)Unit 4Computer Organization & Architecture (COA)Unit 4
Computer Organization & Architecture (COA)Unit 4
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 

Recently uploaded

VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Computer org Architecture module2 ppt.pdf

  • 1. COMPUTER ORGANIZATION AND ARCHITECTURE Dr V. Jayavani Assistant Professor Dept. of CSE, GST Visakhapatnam jvankara2@gitam.edu 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 2. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE UNIT II: Basic Computer Organization and Design • Instruction codes • computer registers • computer instructions • timing and control • instruction cycle • memory-references instructions • input-output and interrupt • complete computer description • Design of the basic computer, design of accumulator logic. • Micro programmed Control: Control memory, address sequencing, micro program example, • design of control unit.
  • 3. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction codes • The organization of the computer is defined by its internal registers, the timing and control structure, and the set of instructions that it uses. • Internal organization of a computer is defined by the sequence of micro-operations it performs on data stored in its registers. • Computer can be instructed about the specific sequence of operations it must perform. User controls this process by means of a Program. • Program: set of instructions that specify the operations, operands, and the sequence by which processing has to occur. • Instruction: a binary code that specifies a sequence of micro-operations for the computer. • The computer reads each instruction from memory and places it in a control register. The control then interprets the binary code of the instruction and proceeds to execute it by issuing a sequence of micro-operations. • Every computer has its own unique instruction set. The ability to store and execute instructions and stored program concept is the most important property of a general purpose computer.
  • 4. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction codes • Instruction Code: group of bits that instruct the computer to perform specific operation. • Instruction code is usually divided into two parts: Opcode and address(operand) Operation Code (opcode): • group of bits that define the operation. Eg: add, subtract, multiply, shift, complement. • No. of bits required for opcode depends on total no. of operations available in computer. • The operation code must consist of at least n-bits for a given 2n (or less) distinct operations.
  • 5. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction codes Operation Code (opcode): • The control unit receives the instruction from memory and interprets the operation code bits. It then issues a sequence of control signals to initiate microoperations in internal computer registers. • For this reason, an operation code is sometimes called a macrooperation because it specifies a set of microoperations. Address (operand): • specifies the location of operands (registers or memory words) • Memory words are specified by their address • Registers are specified by their k-bit binary code that specify one of 2k registers.
  • 6. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Stored Program Organization • The simplest way to organize a computer is to have one processor register and an instruction code format with two parts. • The first part specifies the operation to be performed and the second specifies an address. The memory address tells the control where to find an operand in memory. • This operand is read from memory and used as the data to be operated on together with the data stored in the processor register. • The ability to store and execute instructions is the most important property of a general-purpose computer. That type of stored program concept is called stored program organization.
  • 7. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Stored Program Organization • Instructions are stored in one section of memory and data in another. • For a memory unit with 4096 words we need 12 bits to specify an address since 212 = 4096. • If we store each instruction code in one 16-bit memory word, we have available four bits for the operation code (abbreviated opcode) to specify one out of 16 possible operations, and 12 bits to specify the address of an operand. • Accumulator (AC): Computers that have a single-processor register usually assign to it the name accumulator and label it AC. • The operation is performed with the memory operand and the content of AC.
  • 8. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Stored Program Organization Addressing of Operand: • Sometimes convenient to use the address bits of an instruction code not as an address but as the actual operand. • When the second part of an instruction code specifies an operand, the instruction is said to have an immediate operand. • When the second part specifies the address of an operand, the instruction is said to have a direct address. • When second part of the instruction designate an address of a memory word in which the address of the operand is found such instruction have indirect address.
  • 9. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Stored Program Organization Addressing of Operand: • One bit of the instruction code can be used to distinguish between a direct and an indirect address. • It consists of a 3-bit operation code, a 12-bit address, and an indirect address mode bit designated by I. • The mode bit is 0 for a direct address and 1 for an indirect address.
  • 10. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Direct addressing
  • 11. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Indirect addressing
  • 12. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Problem A computer uses a memory unit with 256Kwords of 32 bits each. A binary instruction code is stored in one word of memory. The instruction has four parts: an indirect bit. an operation code, a register code part to specify one of 64 registers, and an address part. a. How many bits are there in the operation code, the register code part, and the address part? b. Draw the instruction word format and indicate the number of bits in each part. c. How many bits are there in the data and address inputs of the memory?
  • 13. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Problem A computer uses a memory unit with 256Kwords of 32 bits each. A binary instruction code is stored in one word of memory. The instruction has four parts: an indirect bit. an operation code, a register code part to specify one of 64 registers, and an address part. a. How many bits are there in the operation code, the register code part, and the address part? b. Draw the instruction word format and indicate the number of bits in each part. c. How many bits are there in the data and address inputs of the memory? Solution:
  • 14. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Computer Registers • Computer instructions are normally stored in consecutive memory locations and are executed sequentially one at a time. • The control reads an instruction from a specific address in memory and executes it. • It then continues by reading the next instruction in sequence and executes it, and so on. Need of the registers in computer: • Instruction sequencing needs a counter to calculate the address of the next instruction after execution of the current instruction is completed (PC). • Necessary to provide a register in the control unit for storing the instruction code after it is read from memory (IR). • Needs processor registers for manipulating data (AC and TR) and a register for holding a memory address (AR).
  • 15. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Computer Registers • The memory unit has a capacity of 4096 words and each word contains 16 bits. • Twelve bits of an instruction word are needed to specify the address of an operand. • This leaves three bits for the operation part of the instruction and a bit to specify a direct or indirect address.
  • 16. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Computer Registers • The data register (DR) holds the operand read from memory. • The accumulator (AC) register is a general purpose processing register. • The instruction read from memory is placed in the instruction register (IR). • The temporary register (TR) is used for holding temporary data during the processing. • The memory address register (AR) has 12 bits since this is the width of a memory address. • The program counter (PC) also has 12 bits and it holds the address of the next instruction to be read from memory after the current instruction is executed. • Two registers are used for input and output. • The input register (INPR) receives an 8-bit character from an input device. • The output register (OUTR) holds an 8-bit character for an output device.
  • 17. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Common Bus System • The basic computer has eight registers, a memory unit, and a control unit. • Paths must be provided to transfer information from one register to another and between memory and registers. • A more efficient scheme for transferring information in a system with many registers is to use a common bus. • The connection of the registers and memory of the basic computer to a common bus system is shown in Fig. • The outputs of seven registers and memory are connected to the common bus. • The input data and output data of the memory are connected to the common bus, but the memory address is connected to AR.
  • 18. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Common Bus System • The specific output that is selected for the bus lines at any given time is determined from the binary value of the selection variables S2, S1, and S0. • The number along each output shows the decimal equivalent of the required binary selection. For example, the number along the output of DR is 3. The 16-bit outputs of DR are placed on the bus lines when S2S1S0 = 011. • The lines from the common bus are connected to the inputs of each register and the data inputs of the memory. • The particular register whose LD (load) input is enabled receives the data from the bus during the next clock pulse transition.
  • 19. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Common Bus System • The memory receives the contents of the bus when its write input is activated. • The memory places its 16-bit output onto the bus when the read input is activated and S2S1S0 = 111. • Five registers have three control inputs: LD (load), INR (increment), and CLR (clear). • This type of register is equivalent to a binary counter with parallel load and synchronous clear. • Two registers have only a LD input. (IR, OUTR)
  • 20. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Common Bus System • The 16 inputs of AC come from an adder and logic circuit. This circuit has three sets of inputs. • One set of 16-bit inputs come from the outputs of AC. • Another set of 16-bit inputs come from the data register DR. The result of an addition is transferred to AC and the end carry-out of the addition is transferred to flip-flop E (extended AC bit). • A third set of 8-bit inputs come from the input register INPR.
  • 21. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Computer Instructions • A memory-reference instruction uses 12 bits to specify an address and one bit to specify the addressing mode I. I is equal to 0 for direct address and to 1 for indirect address. • An input—output instruction does not need a reference to memory and is recognized by the operation code 111 with a 1 in the leftmost bit of the instruction. The remaining 12 bits are used to specify the type of input—output operation. • The register-reference instructions are recognized by the operation code 111 with a 0 in the leftmost bit (bit 15) of the instruction. • A register-reference instruction specifies an operation on the AC register. So an operand from memory is not needed. Therefore, the other 12 bits are used to specify the operation to be executed.
  • 22. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Memory-Reference Instructions • Opcode = 000 ∼ 110 • I=0 : 0xxx ~ 6xxx, I=1: 8xxx ~Exxx
  • 23. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Register-Reference Instructions • Opcode = 111 • 7xxx (7800 ~ 7001) : CLA, CMA, ….
  • 24. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Input – Output Instructions • Opcode = 000 ∼ 110 • I=0 : 0xxx ~ 6xxx, I=1: 8xxx ~Exxx
  • 25. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction set completeness • A computer should have a set of instructions so that the user can construct machine language programs to evaluate any function that is known to be computable. • The set of instructions are said to be complete if the computer includes a sufficient number of instructions in each of the following categories. 1. Arithmetic, logical and shift instructions 2. Instructions for moving information to and from memory and processor register 3. Program control instructions together with instructions that check status conditions 4. Input and output instructions
  • 26. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction set completeness • Arithmetic, logical, and shift instructions provide computational capabilities for processing the type of data that the user may wish to employ. • The bulk of the binary information in a digital computer is stored in memory, but all computations are done in processor registers. Therefore, the user must have the capability of moving information between these two units. • Decision making capabilities are an important aspect of digital computers. Program control instructions such as branch instructions are used to change the sequence in which the program is executed. • Input and output instructions are needed for communication between the computer and the user. Programs and data must be transferred into memory and results of computations must be transferred back to the user.
  • 27. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction set completeness
  • 28. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction set completeness • There is one arithmetic instruction, ADD, and two related instructions, complement AC (CMA) and increment AC (INC). With these three instructions we can add and subtract binary numbers when negative numbers are in signed-2s complement representation. • The circulate instructions, CIR and CIL, can be used for arithmetic shifts as well as any other type of shifts desired • Multiplication and division can be performed using addition, subtraction, and clear AC (CLA). The AND and complement provide a NAND operation. • Moving information from memory to AC is accomplished with the load AC (LDA) instruction. Storing information from AC into memory is done with the store.
  • 29. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Timing and Control • The timing for all registers in the basic computer is controlled by a master clock generator. • The clock pulses are applied to all flip-flops and registers in the system, including the flip-flops and registers in the control unit. • The clock pulses do not change the state of a register unless the register is enabled by a control signal. • The control signals are generated in the control unit and provide control inputs for the multiplexers in the common bus, control inputs in processor registers, and microoperations for the accumulator.
  • 30. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Control Unit • There are two major types of control organization, hardwired control and microprogrammed control. • In the hardwired organization, the control logic is implemented with gates, flip- flops, decoders, and other digital circuits. It has the advantage that it can be optimized to produce a fast mode of operation. • In the microprogrammed organization, the control information is stored in a control memory. The control memory is programmed to initiate the required sequence of microoperations. • A hardwired control requires changes in the wiring among the various components if the design has to be modified or changed. • In the microprogrammed control, any required changes or modifications can be done by updating the microprogram in control memory.
  • 31. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Timing and Control
  • 32. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Timing and Signals • Generated by 4-bit sequence counter and 416 decoder • The SC can be incremented or cleared.
  • 33. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Instruction Cycle • A program residing in the memory unit of the computer consists of a sequence of instructions. • The program is executed in the computer by going through a cycle for each instruction. Each instruction cycle in turn is subdivided into a sequence of subcycles or phases. • In the basic computer each instruction cycle consists of the following phases: • 1. Fetch an instruction from memory. • 2. Decode the instruction. • 3. Read the effective address from memory if the instruction has an indirect address. • 4. Execute the instruction. • Upon the completion of step 4, the control goes back to step 1 to fetch, decode, and execute the next instruction. • This process continues indefinitely unless a HALT instruction is encountered.
  • 34. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Fetch and Decode • Initially, the program counter PC is loaded with the address of the first instruction in the program. • The sequence counter SC is cleared to 0, providing a decoded timing signal T0. • After each clock pulse, SC is incremented by one, so that the timing signals go through a sequence T 0 , T i, T 2 , and so on. • The microoperations for the fetch and decode phases can be specified by the following register transfer statements.
  • 35. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Register transfer for Fetch Phase
  • 36. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Determine the type of Instruction Flowchart for Instruction cycle
  • 37. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Register-Reference Instructions • Register Reference Instructions are identified when - D7 = 1, I = 0 - Register Ref. Instr. is specified in b0 ~ b11 of IR - Execution starts with timing signal T3 r = D7 I’T3 => Register Ref Instruction Bi = IR(i) , i=0,1,2,...,11
  • 38. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Memory Reference Instructions
  • 39. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Memory Reference Instructions 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 to AC and store carry in E 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
  • 40. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Memory Reference Instructions BSA: Branch and Save Return Address D5T4: M[AR]  PC, AR  AR + 1 D5T5: PC  AR, SC  0
  • 41. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Memory Reference Instructions 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
  • 42. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Memory Reference Instructions Flowchart
  • 43. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE INPUT-OUTPUT and INTERRUPT • A computer can serve no useful purpose unless it communicates with the external environment. • Instructions and data stored in memory must come from some input device. • Computational results must be transmitted to the user through some output device. • Commercial computers include many types of input and output devices. • To demonstrate the most basic requirements for input and output communication, we will use as an illustration a terminal unit with a keyboard and printer.
  • 44. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE INPUT-OUTPUT Configuration • The terminal sends and receives serial information. Each quantity of information has eight bits of an alphanumeric code. • The serial information from the keyboard is shifted into the input register INPR. • The serial information for the printer is stored in the output register OUTR. • INPR and OUTR registers communicate with a communication interface serially and with the AC in parallel. The input-output configuration is shown in Figure. • The flags are needed to synchronize the timing difference between I/O device and the computer
  • 45. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE INPUT-OUTPUT Configuration • The flag bit (FGI) is set to 1 when new information is available in the input device and is cleared to 0 when the information is accepted by the computer. • The computer checks the flag bit (FGO); if it is 1, the information from AC is transferred in parallel to OUTR and FGO is cleared to 0.
  • 46. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE INPUT-OUTPUT Instructions p: SC  0 Clear SC INP pB11: AC(0-7)  INPR, FGI  0 Input char. to AC OUT pB10: OUTR  AC(0-7), FGO  0 Output char. from AC 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 D7 =1, I=1 D7IT3 = p IR(i) = Bi, i = 6, …, 11
  • 47. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Communication with I/O Two ways  1) Programmed I/O 2) Interrupt I/O • Programmed I/O: BACK: SKI BUN BACK INP • Input-output device can transfer information at a maximum rate of 10 characters per second.  equivalent to one character every 100,000 uS. • Two instructions are executed when the computer checks the flag bit and decides not to transfer the information. • This means that at the maximum rate, the computer will check the flag 50,000 times between each transfer. • The computer is wasting time while checking the flag instead of doing some other useful processing task.
  • 48. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Program Interrupt • Open communication only when some data has to be passed --> interrupt. • The I/O interface, instead of the CPU, monitors the I/O device. • When the interface founds that the I/O device is ready for data transfer, it generates an interrupt request to the CPU • Upon detecting an interrupt, the CPU stops momentarily the task • it is doing, branches to the service routine to process the data transfer, and then returns to the task it was performing. • IEN (Interrupt-enable flip-flop) • can be set and cleared by instructions • when cleared, the computer cannot be interrupted
  • 49. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Flowchart for Interrupt Cycle
  • 50. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Interrupt Cycle
  • 51. 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Complete Computer Description
  • 52. Complete Computer Description 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 53. Control Logic functions 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 54. Control of Registers and Memory 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 55. Control of Common Bus 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 56. Design of Accumulator Logic 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 57. Control of AC Register Gate Structure for controlling LD,INR and CLR of AC 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 58. One stage of adder and logic circuit 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 59. Control Unit Implementation • Hardwired • Microprogrammed Instruction code Combinational Logic Circuits Memory Sequence Counter . . Control signals Control signals Next Address Generator (sequencer) CAR Control Memory CDR Decoding Circuit Memory . . CAR: Control Address Register CDR: Control Data Register Instruction code 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 60. Microprogrammed Control Unit  Control signals  Group of bits used to select paths in multiplexers, decoders, arithmetic logic units  Control variables  Binary variables specify microoperations  Certain microoperations initiated while others idle  Control word  String of 1’s and 0’s represent control variables 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 61. Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE Microprogrammed Control Unit  Control memory  Memory contains control words  Microinstructions  Control words stored in control memory  Specify control signals for execution of microoperations  Microprogram  Sequence of microinstructions 26 December 2023
  • 62. Control Memory  Read-only memory (ROM)  Content of word in ROM at given address specifies microinstruction  Each computer instruction initiates series of microinstructions (microprogram) in control memory  These microinstructions generate microoperations to  Fetch instruction from main memory  Evaluate effective address  Execute operation specified by instruction  Return control to fetch phase for next instruction Control memory (ROM) Control word (microinstruction) Address 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 63.  Control memory  Contains microprograms (set of microinstructions)  Microinstruction contains  Bits initiate microoperations  Bits determine address of next microinstruction  Control address register (CAR)  Specifies address of next microinstruction Microprogrammed Control Organization Control word Next Address Generator (sequencer) CAR Control Memory (ROM) CDR External input 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 64. Microprogrammed Control Organization  Next address generator (microprogram sequencer)  Determines address sequence for control memory  Microprogram sequencer functions  Increment CAR by one  Transfer external address into CAR  Load initial address into CAR to start control operations 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 65. Microprogrammed Control Organization  Control data register (CDR)- or pipeline register  Holds microinstruction read from control memory  Allows execution of microoperations specified by control word simultaneously with generation of next microinstruction  Control unit can operate without CDR Control word Next Address Generator (sequencer) CAR Control Memory (ROM) External input 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 66. Microprogram Routines  Routine  Group of microinstructions stored in control memory  Each computer instruction has its own microprogram routine to generate microoperations that execute the instruction 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 67. Microprogram Routines  Subroutine  Sequence of microinstructions used by other routines to accomplish particular task  Example  Subroutine to generate effective address of operand for memory reference instruction  Subroutine register (SBR)  Stores return address during subroutine call 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 68. Conditional Branching  Branching from one routine to another depends on status bit conditions  Status bits provide parameter info such as  Carry-out of adder  Sign bit of number  Mode bits of instruction  Info in status bits can be tested and actions initiated based on their conditions: 1 or 0  Unconditional branch  Fix value of status bit to 1 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 69. Mapping of Instruction  Each computer instruction has its own microprogram routine stored in a given location of the control memory  Mapping  Transformation from instruction code bits to address in control memory where routine is located 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 70. Mapping of Instruction  Example  Mapping 4-bit operation code to 7-bit address OP-codes of Instructions ADD AND LDA 0000 0001 0010 Address 0 0000 00 0 0001 00 0 0010 00 Mapping bits 0 xxxx 00 ADD Routine AND Routine LDA Routine Control memory 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 71. Address Sequencing  Address sequencing capabilities required in control unit  Incrementing CAR  Unconditional or conditional branch, depending on status bit conditions  Mapping from bits of instruction to address for control memory  Facility for subroutine call and return 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 72. Address Sequencing Instruction code Mapping logic Multiplexers Control memory (ROM) Subroutine Register (SBR) Branch logic Status bits Microoperations Control Address Register (CAR) Incrementer MUX select select a status bit Branch address 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 73. Microprogram Example Computer Configuration MUX AR 10 0 PC 10 0 Address Memory 2048 x 16 MUX DR 15 0 Arithmetic logic and shift unit AC 15 0 SBR 6 0 CAR 6 0 Control memory 128 x 20 Control unit 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 74. Microprogram Example Microinstruction Format EA is the effective address Symbol OP-code Description ADD 0000 AC  AC + M[EA] BRANCH 0001 if (AC < 0) then (PC  EA) STORE 0010 M[EA]  AC EXCHANGE 0011 AC  M[EA], M[EA]  AC Computer instruction format I Opcode 15 14 11 10 Address 0 Four computer instructions F1 F2 F3 CD BR AD 3 3 3 2 2 7 F1, F2, F3: Microoperation fields CD: Condition for branching BR: Branch field AD: Address field 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 75. Microinstruction Fields F1 Microoperation Symbol 000 None NOP 001 AC  AC + DR ADD 010 AC  0 CLRAC 011 AC  AC + 1 INCAC 100 AC  DR DRTAC 101 AR  DR(0-10) DRTAR 110 AR  PC PCTAR 111 M[AR]  DR WRITE F2 Microoperation Symbol 000 None NOP 001 AC  AC - DR SUB 010 AC  AC  DR OR 011 AC  AC  DR AND 100 DR  M[AR] READ 101 DR  AC ACTDR 110 DR  DR + 1 INCDR 111 DR(0-10)  PC PCTDR F3 Microoperation Symbol 000 None NOP 001 AC  AC  DR XOR 010 AC  AC’ COM 011 AC  shl AC SHL 100 AC  shr AC SHR 101 PC  PC + 1 INCPC 110 PC  AR ARTPC 111 Reserved 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 76. Microinstruction Fields CD Condition Symbol Comments 00 Always = 1 U Unconditional branch 01 DR(15) I Indirect address bit 10 AC(15) S Sign bit of AC 11 AC = 0 Z Zero value in AC BR Symbol Function 00 JMP CAR  AD if condition = 1 CAR  CAR + 1 if condition = 0 01 CALL CAR  AD, SBR  CAR + 1 if condition = 1 CAR  CAR + 1 if condition = 0 10 RET CAR  SBR (Return from subroutine) 11 MAP CAR(2-5)  DR(11-14), CAR(0,1,6)  0 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 77. Symbolic Microinstruction  Sample Format Label: Micro-ops CD BR AD  Label may be empty or may specify symbolic address terminated with colon  Micro-ops consists of 1, 2, or 3 symbols separated by commas  CD one of {U, I, S, Z} U: Unconditional Branch I: Indirect address bit S: Sign of AC Z: Zero value in AC  BR one of {JMP, CALL, RET, MAP}  AD one of {Symbolic address, NEXT, empty} 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 78. Fetch Routine  Fetch routine - Read instruction from memory - Decode instruction and update PC AR  PC DR  M[AR], PC  PC + 1 AR  DR(0-10), CAR(2-5)  DR(11-14), CAR(0,1,6)  0 Symbolic microprogram for fetch routine: ORG 64 PCTAR U JMP NEXT READ, INCPC U JMP NEXT DRTAR U MAP FETCH: Binary microporgram for fetch routine: 1000000 110 000 000 00 00 1000001 1000001 000 100 101 00 00 1000010 1000010 101 000 000 00 11 0000000 Binary address F1 F2 F3 CD BR AD Microinstructions for fetch routine: 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 79. Symbolic Microprogram • Control memory: 128 20-bit words • First 64 words: Routines for 16 machine instructions • Last 64 words: Used for other purpose (e.g., fetch routine and other subroutines) • Mapping: OP-code XXXX into 0XXXX00, first address for 16 routines are 0(0 0000 00), 4(0 0001 00), 8, 12, 16, 20, ..., 60 ORG 0 NOP READ ADD ORG 4 NOP NOP NOP ARTPC ORG 8 NOP ACTDR WRITE ORG 12 NOP READ ACTDR, DRTAC WRITE ORG 64 PCTAR READ, INCPC DRTAR READ DRTAR I U U S U I U I U U I U U U U U U U U CALL JMP JMP JMP JMP CALL JMP CALL JMP JMP CALL JMP JMP JMP JMP JMP MAP JMP RET INDRCT NEXT FETCH OVER FETCH INDRCT FETCH INDRCT NEXT FETCH INDRCT NEXT NEXT FETCH NEXT NEXT NEXT ADD: BRANCH: OVER: STORE: EXCHANGE: FETCH: INDRCT: Label Microops CD BR AD Partial Symbolic Microprogram 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 80. Binary Microprogram Address Binary Microinstruction Micro Routine Decimal Binary F1 F2 F3 CD BR AD ADD 0 0000000 000 000 000 01 01 1000011 1 0000001 000 100 000 00 00 0000010 2 0000010 001 000 000 00 00 1000000 3 0000011 000 000 000 00 00 1000000 BRANCH 4 0000100 000 000 000 10 00 0000110 5 0000101 000 000 000 00 00 1000000 6 0000110 000 000 000 01 01 1000011 7 0000111 000 000 110 00 00 1000000 STORE 8 0001000 000 000 000 01 01 1000011 9 0001001 000 101 000 00 00 0001010 10 0001010 111 000 000 00 00 1000000 11 0001011 000 000 000 00 00 1000000 EXCHANGE 12 0001100 000 000 000 01 01 1000011 13 0001101 001 000 000 00 00 0001110 14 0001110 100 101 000 00 00 0001111 15 0001111 111 000 000 00 00 1000000 FETCH 64 1000000 110 000 000 00 00 1000001 65 1000001 000 100 101 00 00 1000010 66 1000010 101 000 000 00 11 0000000 INDRCT 67 1000011 000 100 000 00 00 1000100 68 1000100 101 000 000 00 10 0000000 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 81. Design of Control Unit microoperation fields 3 x 8 decoder 7 6 5 4 3 2 1 0 F1 3 x 8 decoder 7 6 5 4 3 2 1 0 F2 3 x 8 decoder 7 6 5 4 3 2 1 0 F3 Arithmetic logic and shift unit AND ADD DRTAC AC Load From PC From DR(0-10) Select 0 1 Multiplexers AR Load Clock AC DR DRTAR PCTAR 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 82. Microprogram Sequencer 3 2 1 0 S1 MUX1 External (MAP) SBR Load Incrementer CAR Input logic I0 T MUX2 Select 1 I S Z Test Clock Control memory Microops CD BR AD L I1 S0 . . . . . . 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE
  • 83. Input Logic for Microprogram Sequencer Input logic I0 I1 T MUX2 Select 1 I S Z Test CD Field of CS From CPU BR field of CS L(load SBR with PC) for subroutine Call S0 S1 for next address selection I1I0T Meaning Source of Address S1S0 L 000 In-Line CAR+1 00 0 001 JMP CS(AD) 01 0 010 In-Line CAR+1 00 0 011 CALL CS(AD) and SBR <- CAR+1 01 1 10x RET SBR 10 0 11x MAP DR(11-14) 11 0 L S1 = I1 S0 = I0I1 + I1’T L = I1’I0T Input Logic 26 December 2023 Department of CSE, GST Course Code and Course Title: CSEN2011: COMPUTER ORGANIZATION AND ARCHITECTURE