Professional Documents
Culture Documents
Bus Interconnection
1. Bus is communication path between two or more components
2. Shared Transmission Medium
3. Signal Tx by One Device is available to Rx by all the other Devices
attached to bus.
4. Only one can successfully transmit at one point of time.
5. It consists of Multiple communication pathways (Lines - Serial and
Parallel).
6. Bus Connecting Major Components Like CPU, Memory and I/O is
called as System Bus.
Bus Interconnection Scheme
3
Bus Structure
1. Bus consists of 50-100 Separate Lines.
2. Data,Address, Control Lines.
3. Data Lines:- : Provides path for moving Data between Devices
(8,16,32,Bits).
4. Address Lines:- Used to Designate Source or Destination of the
data in data bus.
5. Control Lines:- Used to Control data and address lines. Transmits
both commands and timings information between modules.
Memory Write, Memory Read, I/0 Write, I/0 Read, Transfer Ack, Bus
Request, Bus Grant, Interrupt Request, Interrupt Ack, Clock and
Reset.
Multiple Bus Hierarchy
High Performance Architecture
Element Of Bus Design
Slip Test 1
5 Questions X 5 Marks = Total 25 Marks
1. Brief Description of Computer Evolution?
2. Define Bus, Bus Structure and Different types of Bus,
Elements of Bus Design?
3. Explain Multiplexer, 4-Bit Shift Register Draw its
Truth Table?
4. Draw S-R, D, J-K, J-K Master Slave and T Flip Flop and
Explain it with Truth Table?
5. Convert the Given number (999)10 in to Binary, Octal
and Hexa Decimal number?
Evolution of INTEL Micro Processor
Read
Memory
AR unit
Write
Registers.
ARITHMETIC MICROOPERATIONS
Symbol Description
Contents of R1 plus R2 transferred to R3
R3 R1 + R2
Contents of R1 minus R2 transferred to R3
R3 R1 - R2
R2 R2 Complement the contents of R2
R3 R1 + R2+ 1
2's complement the contents of R2 (negative)
R2 R2+ 1 2s Complement
R1 R1 + 1 Increment
R1 R1 1 Decrement
BINARY ADDER / SUBTRACTOR /
INCREMENTER
Binary Adder
Binary Adder-Subtractor
A3 A2 A1 A0 1
x y x y x y x y
Binary Incrementer HA HA HA HA
C S C S C S C S
C4 S3 S2 S1 S0
4 Bit Arithmetic Circuit
Arithmetic Table Function Table
F3 = x FA Transfer A
F4 = x'y F A B
F5 = y FB Transfer B
F6 = x y FAB Exclusive-OR
F7 = x + y FAB OR
F8 = (x + y)' F A B) NOR
F9 = (x y)' F (A B) Exclusive-NOR
F13 = x' + y F A B
S1 S0 Output -operation
0 0 F=AB AND
0 1 F = AB OR
1 0 F=AB XOR
1 1 F = A Complement
Logic micro operations can be used to manipulate individual bits or a
portions of a word in a register
1100 At
1010 B
1110 At+1 (A A + B)
If a bit in B is set to 1, that same position in A gets set to 1,
otherwise that bit in A keeps its previous value
SELECTIVE COMPLEMENT
1100 At
1010 B
0100 At+1 (A A B)
1100 At
1010 B
1000 At+1 (A A B)
This is done as A mask operation to clear the desired bit positions, followed by
Suppose you wanted to introduce 1010 into the low order four bits of
A:1101 1000 1011 0001 A (Original) 1101 1000 1011 1010 A (Desired)
Logical shift
Circular shift
Arithmetic shift
What differentiates them is the information that goes into the serial input
Serial
input
Serial
input
LOGICAL SHIFT
In a logical shift the serial input to the shift is a 0.
A right logical shift operation:
The main distinction of an arithmetic shift is that it must keep the sign of
the number the same as it performs the multiplication or division
sign
bit
0
sign
bit
Before the shift, if the leftmost two bits differ, the shift will result in an
overflow
S
MUX H0
0
1
A0
A1 S
MUX H1
0
A2 1
A3
S
MUX H2
0
1
S
MUX H3
0
1
Serial
input (IL) Select Line H0 H1 H2 H3
0 IR A0 A1 A2
1 A1 A2 A3 IL
ARITHMETIC LOGIC SHIFT UNIT
S3
S2 C
i
S1
S0
D
Arithmetic i
Circuit
Select
0 4x1 F
C i+1 i
1 MUX
2
3
E
Logic i
B
i Circuit
A
i
shr
A
i-1
shl
A
i+1
Unit II
Basic Computer
Organization and Design
BASIC COMPUTER ORGANIZATION AND
DESIGN
Instruction Codes
Computer Registers
Computer Instructions
Timing and Control
Instruction Cycle
Memory Reference instructions
Input-Output and Interrupt
Central Processing Unit
Stack Instruction Formats
Addressing modes
Data Transfer and Manipulations
Program and RISC
INSTRUCTION CODES
1. Organization of computer is defined by its Internal Registers, Timing
and Control structure and Instructions that it uses.
2. Internal Organization of a digital system is defined by Sequence of
micro operations it performs on data stored in registers.
3. User of a computer can control the process by means of a program.
4. Program is a set of Instructions that specify the operations, operands,
and Sequence by which it Operates.
5. Computer Instruction is a Binary Code that Specifies a Sequence of
Micro Operations for the computer.
6. Instruction Code is group of bits the instructs the computer to perform
a specific operation.
INSTRUCTION CODES
Operation code of a Instruction is a group of bits that define operations
such as ADD, Subtract, Multiply, Shift, and complement.
No of Bits depends of no of operations performed by computer.
STORED PROGRAM ORGANIZATION
One Processor Register and an Instruction Code format with two parts,
First Part is Opcode and Second Specifies Address.
Memory Address tells the control where to find an operand in Memory.
The Operand is read from memory and used as data to be operated on
together with data stored in Processor Register.
ACCUMULATOR
Computers that have Single Processor Register usually assign to
Accumulator (AC).
The Operation is performed with the Memory Operand and Content of AC.
For the above operation the bits from 0-11 is not needed for specifying a
memory address, It can be used to specify other operations for the
computer.
ADDRESSING MODES
COMPUTER REGISTERS
COMPUTER REGISTERS
COMMON BUS SYSTEM
COMMON BUS SYSTEM
Computer will have 8 Registers, Memory Unit and a Control unit.
Load is Enabled receives data from bus during the next clock transaction.
LD, INR, CLR registers equivalent to a binary counter with parallel load.
COMMON BUS SYSTEM
16 Inputs of Accumulator come from an Adder and Logic Circuit, Circuit
has 3 sets of inputs.
1. Output of Accumulator Ex. Complement, Shift.
2. Data Register (DR) Ex. Arithmetic and Logical Micro Operations.
3. INPR.
Input Register INPR and Output Register OUTR have 8 bits each and
communicate with the LSB 8 bits of BUS.
Two Decoders and one Sequence Counter & Control Logic Gates
Instruction read from memory is place in IR(I, OPCODE, ADDRESS).
OPCODE:- Decoded With 3x8 Decoder, Eight Outputs D0-D7.
I- It is given to Flip Flop.
Bit 0-11 are applied to Control Logic.
4-bit Sequence Counter Can count from 0-15 . Outputs of the
Counter are Decoded in to 16 Timing Signals T0-T15.
TIMING SIGNALS
INSTRUCTION CYCLE
T0: PC AR
T1: IR M[AR], PC PC + 1
1) Place the content of PC onto the bus by making the bus selection
inputs S2S1S0 equal to 010.
2) Transfer the content of the bus to AR by enabling the LD input of
AR.
3) The Next clock transition initiates the transfer from PC to AR since
T0=1, In order to implement the second statement.
T1 : IR M[AR], PC PC + 1
Timing Signal T1
D~7IT3 : AR M[AR]
D~7IT3 : Nothing
AND to AC
D0T4 : DR M[AR]
D0T5: AC AC DR
ADD to AC
D1T4: DRM[AR]
D1T3: ACAC + DR, E Cout SC0
LDA: Load to AC
D2T4: DRM[AR]
D2T5: ACDR, SC 0
STA: Store AC
D3T4: M[AR] AC, SC0
INPUT-OUTPUT AND INTERUPPT
INPUT-OUTPUT INSTRUCTIONS
INPUT-OUTPUT AND INTERUPPT
Central Processing Unit
1. Part of Computer that Perform Bulk data procession operations is called
Central Procession Unit.
2. CPU is made of three Units 1)Register Set 2) ALU 3) Control Unit
3. Instruction formats, Addressing modes, Instruction set.
4. General Organization of the CPU registers leading to two architectures RISC
(Reduced Instruction Set Computer) CISC (Complex Instruction Set Computer)
5. Based on Memory Usage for data and programs it is of two types embedded
(Harvard Computer Architecture) and non embedded (SPC).
General Register Organization
Input
Clock
R1
R2
R3
R4
Binary
R5
Code SELA SELB SELD
R6
000 Input Input None
001 R1 R1 R1
R7
010 R2 R2 R2
Load
(7 lines)
011 R3 R3 R3
{ } 100 R4 R4 R4
SELA
MUX MUX SELB
101 R5 R5 R5
110 R6 R6 R6
3x8
decoder
A bus B bus 111 R7 R7 R7
SELD
OPR ALU
Output
ALU CONTROL
OPR
Encoding of ALU operations Select Operation Symbol
00000 Transfer A TSFA
00001 Increment A INCA
00010 ADD A + B ADD
Control Word 00101 Subtract A - B SUB
00110 Decrement A DECA
3 3 3 5
01000 AND A and B AND
SELA SELB SELD OPR 01010 OR A and B OR
01100 XOR A and B XOR
01110 Complement A COMA
10000 Shift right A SHRA
11000 Shift left A SHLA
FULL EMPTY
Stack pointer
4
SP C 3
6 bits B 2
A 1
DR
STACK ORGANIZATION
Push
Stack Address
63
SP SP+1
Flags
M[SP] DR
FULL EMPTY If (SP = 0) Then (FULL 1)
EMTY 0
Stack Pointer 4
SP 3
POP
C
6 bits B
2 DR M[SP]
SP SP-1
1
A
0
PC Program
(instructions)
AR Data
(operands)
3000
SP
stack
3997
3998
3999
4000
4001
REVERSE POLISH NOTATION
Arithmetic Expressions: A + B
A + B Infix notation
+ A B Prefix or Polish notation
A B + Postfix or reverse Polish notation
- The reverse Polish notation is very suitable for stack
manipulation
(3 * 4) + (5 * 6) 34*56*+
6
4 5 5 30
3 3 12 12 12 12 42
3 4 * 5 6 * +
INSTRUCTION FORMATS
An Operation Code field that specifies the operation to be
performed.(ADD, SUB, Complement and Shift)
An Address Field that designates a memory address or a processor
register.
A mode field that specifies the way the operand or the effective address
is determined.
Single Accumulator Organization (Operations Implied on AC register)
ADD X AC AC + M[X]
X = (A + B) * (C + D)
Three Address Instructions
ADD R1, A, B R1 M[A] + M[B]
ADD R2, C, D R2 M[C] + M[D]
MUL X,R1,R2 M[X] R1 * R2
Two Address Instructions
MOV R1, A R1 M[A]
ADD R1, B R1 R1 + M[B]
MOV R2, C R2 M[C]
ADD R2, D R2 R2 + M[D]
MUL R1,R2 R1 R1 * R2
MOV X, R1 M[X] R1
DATA TRANSFER AND DATA MANIPULATION
Most Computer Instructions are classified in to three
2. Data Manipulation
3. Program Control
2. Register Mode
Register Indirect Mode :- Specifies a register in CPU, Whose contents give the
address of operand in memory.
Advantage in indirect mode is that the address field of the instruction uses fewer
bits to select register.
Auto Increment or Auto Decrement Mode:- Similar to register indirect mode that
the register is incremented or decremented after or before its value is used to
access the memory.
Register refers to a table of data in memory.
ADDRESSING MODES
Effective Address:- It is used by the control unit in the CPU to obtain the
operand from memory.
Direct Address Mode:- In this mode the effective address is equal to the
address of instruction. Address is given directly by the address field of the
instruction
Indirect Address Mode:- Address field of the instruction gives the address
where effective address is stored in memory.
ADDRESSING MODES
Relative Addressing Mode :- In this mode Contents of PC added to
Address part of Instruction in order to obtain Effective Address.
Used When data and program are moved from one Segment of memory
to another
Memory Organization
Memory Hierarchy
MEMORY:- It is used to store program and data.
Main Memory:- The memory that communicates directly with the CPU is
called Main Memory.
Auxiliary Memory:- The memory that provides back up Storage are called
Auxiliary Memory. Examples:- Magnetic Disks and Tapes.
They are used for storing system programs, Large Files, and other
backup information.
Cache Memory:- Very High Speed Memory called cache used to increase
the speed of processing by making current programs and data available to
CPU at a rapid rate.
1. Main Memory is based on Semi Conductor Integrated Circuits.
Memory Mapping
Address Space Assignment to each memory chip.
Memory Connection to CPU
1. RAM and ROM chips are connected to a CPU through the data and
address buses.
2. Lower Order lines in the address bus select the byte with in the chips
and other lines in the address bus selects particular chip through chip
selection.
3. 7-Lower Bits used to select one of the 128 Possible Bytes.
4. 8-9 Lines in the address bus to select the RAM.
5. Selection Between RAM and ROM is achieved through bus line 10.
6. The RAMs are Selected when the bit in this line is 0, ROM when bit is 1.
7. Address Lines 1-9 are applied to the input address of ROM without
going through the decoder.
8. Data bus of ROM has only an output Capability, Where as data bus
connected to the RAMs can transfer information in both directions.
Memory Connection to CPU
Auxiliary Memory
Most common memory device used in computer Systems are magnetic
disks and tapes.
Important Characteristics of any device are its Access mode, Access time,
Transfer rate, Capacity and Cost.
Electro Mechanical Devices with moving parts such as disks and tapes,
The access time consists of a Seek time required to position the read and
read-write head to a location.
Associative memory is more expensive than RAM, Each cell must have a
storage capability as well as logic circuits for matching its contents with
external argument.
Application's where the search time is very critical and must be very short.
Hardware Organization
Associative Memory of m Word, n Cells per One Cell Associative Memory
Word
MATCH Logic For One word
MI = X 1+ X 2 + X3 . . .
Xj + K~ j = Xj if Kj = 1
Xj + K~ j = 1 if Kj = 0
MI = (X 1 + K~ 1 ) (X 2 + K~ 2 ) (X 3 + K~ 3 )
Cache Memory
The Active portions of the program and data are placed in a fast small memory,
The average Memory access time can be reduced, Thus Reducing the execution
time of program.
Cache Access time is less than the Access time of main memory by a factor of 5
to 10.
Cache is the fastest component in the memory hierarchy and approaches the
speed of CPU Components.
Operation of cache: When CPU needs to access the memory. First the cache is
examined If word is found in the cache, it is read from fast memory, if word is
not found main memory is accessed to read the word.
HIT Ratio
When CPU refers to the memory and finds the word in cache it is said to
produce one hit, If word is not found in the cache, it is in main memory and it
counts miss.
HIT Ratio:- The ratio of the no. of hits divided by the Total CPU references to
memory (Hit + Miss).
Computer with cache access time is 100ns, while main memory access time of
1000ns.
Memory Mapping
The Transformation of data from main memory to cache memory is referred
to as a mapping process.
1. Associative mapping
2. Direct mapping
3. Set-Associative Mapping
Associative Mapping
Associate memory stores both the address and content of the memory word.
The address value of 15bits is shown in five digit octal number and its
corresponding 12 bit word is shown as a four digit octal number.
CPU Address of 15bit is placed in the argument register and the associative
memory is searched for matched address.
If the address is found corresponding 12bit data is read and sent to the CPU.
address (15 bits)
Argument register
Address Data
01000 3450
CAM 02777 6710
22235 1234
DIRECT MAPPING
CPU address of 15-Bit is divided in to two fields 9 Least Significant Bits
constitute the index and remaining six bits form Tag field.
Each word in cache consists of data word and its associative tag word.
Tag Field of the CPU Address is tag in the word read from cache. If tag matches,
There is a hit or else if it doesnt match its a miss and the required word is read
Memory
address Memory data
00000 1220 00 000
32K x 12
000
Index 512 x 12
address Tag Data
00777 2340 Main memory Cache memory
01000 3450 000 00 1220 Address = 15 bits
Address = 9 bits
Data = 12 bits
Data = 12 bits
777
77 777
01777 4560
02000 5670
02777 6710
777 02 6710
Block 63 770 02
777 02 6710
VIRTUAL MEMORY
ADDRESS SPACE : An address used by programmer will be called a Virtual
Memory, Set of such addresses the Address Space.
2. At any given point of time 4 pages of address space may reside in main memory
in any one of the four blocks.
2. Memory page table consists of eight words, one for each page.
3. Address in page table denotes the page number and the content of the word
gives block number where the page is stored in main memory.
4. Pages 1,2,5 and 6 are now available in main memory blocks 3,0,1 and 2.
ASSOCIATIVE MEORY PAGE TABLE
1. More efficient way is to organize the page table
would be to construct it with number of words
equal to number of blocks in main memory.
2. Page fault occurs the execution of present program is suspended until the
required page is brought in to main memory.
3. When a page fault occurs in a virtual memory system , it signifies that the page
referenced by the CPU is not in main memory. If memory is full, it would be
necessary to remove a page from memory
6. In Bus organized systems the control signals that specify micro-operations are
group of bits that selects the path in mux, Decoders and in ALUs.
Control Memory
Control Unit Implementation
Micro program
Control Memory
Control Word:- Control unit initiates a series of sequential steps of Micro
Operations.
Control Variables at any given time can be represented by a string of 1s and 0s
called a control word.
micro programmed Control unit:- Control unit whose binary control variables
are stored in memory.
Micro Instruction:- Each word in control memory contains with in it a micro
instruction.
Micro Instruction Micro Program:- A sequence of micro instructions constitutes
a Micro Program.
Control Memory:- All the control information is stored in Permanently, Control
memory is Read Only Memory.
The use of Micro Program is involves placing all the control variables in words if
ROM.
Control Address Register:- Specifies the address of micro instruction.
Address Sequencing
Increment
MUX
Control memory
...
Status bits
(condition)
Next address
If Condition is true, then Branch (address from the next address field of the
current microinstruction)
else Fall Through Conditions to Test: O(overflow), N(negative), Z(zero), C(carry)
etc.
Unconditional Branch
Fixing the value of one status bit at the input of the multiplexer to 1
MAPPING OF INSTRUCTIONS
Direct Mapping Address
OP-codes of Instructions 0000 ADD Routine
0001 AND Routine
ADD 0000
. 0010 LDA Routine
AND 0001
. 0011 STA Routine
LDA 0010 . 0100 BUN Routine
STA 0011
BUN 0100 Control
Storage
Mapping
Bits 10 xxxx 010 Address
10 0000 010 ADD Routine
Machine OP-code
Instruction 1 0 1 1 Address
Mapping bits 0 x x x x 0 0
Microinstruction 0 1 0 1 1 0 0
address
Mapping function implemented by ROM or PLA
OP-code
Mapping memory
(ROM or PLA)
Control Memory
MICROPROGRAM EXAMPLE
Computer Configuration:
MUX
10 0
AR
Address Memory
10 0 2048 x 16
PC
MUX
15 0
6 0 6 0 DR
SBR CAR
MicroInstruction Format
3 3 3 2 2 7
F1 F2 F3 CD BR AD
Sample Format :
Five fields: label; micro-ops; CD(Condition For Branching) BR; AD
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
MICROINSTRUCTION FIELD DESCRIPTIONS - CD, BR
ORG 4
BRANCH: NOP S JMP OVER
NOP U JMP FETCH
OVER: NOP I CALL INDRCT
ARTPC U JMP FETCH
ORG 8
STORE: NOP I CALL INDRCT
ACTDR U JMP NEXT
WRITE U JMP FETCH
ORG 12
EXCHANGE: NOP I CALL INDRCT
READ U JMP NEXT
ACTDR, DRTAC U JMP NEXT
WRITE U JMP FETCH
ORG 64
FETCH: PCTAR U JMP NEXT
READ, INCPC U JMP NEXT
DRTAR U MAP
INDRCT: READ U JMP NEXT
DRTAR U RET
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
Microoperation fields
F1 F2 F3
AND
ADD AC
Arithmetic
logic and
DRTAC DR
shift unit
PCTAR
DRTAR
From From
PC DR(0-10) Load
AC
Select 0 1
Multiplexers
Load Clock
AR
MICROPROGRAM SEQUENCER
External
(MAP)
L
I0 3 2 1 0
Input Load
I1 S1 MUX1 SBR
logic
T S0
1 Incrementer
I MUX2 Test
S
Z Select
Clock CAR
Control memory
Microops CD BR AD
... ...
MICROPROGRAM SEQUENCER
Input Logic
I0I1T Meaning Source of Address S1S0 L
S0 = I 0
S1 = I0I1 + I0T
L = I0I1T
UNIT 4
Cpmputer Arithmatic
Arithmetic Algorithms
Arithmetic Algorithm and Procedure for implementing them with digital
Hardware.
In subtraction, when the signs of A and B are different, add the two
magnitudes and attach the sign of A to the result.
In addition, when signs of A and B are different, compare the magnitudes and
subtract smaller from the larger. Choose the sign of the result to be same as A
if A>B or complement of A if A < B. If the two magnitudes are equal, subtract B
from A and make the sign of result positive.
A (-B) A+B
A-B A + (-B)
A=5 and B=2
5 2 => 101
110 Different
Same sign
sign
---------
=3 1 011
Here, A = 011 and E=1 A (-B) A+B
A-B A + (-B)
011
---------
= -3 101
Here, A = 101 and E=0
=> Correct answer = 2s
complement of A = 011
with As=1
INPUT OUTPUT
ORGANIZATION
INPUT-OUTPUT ORGANIZATION
Peripheral Devices
Input-Output Interface
Modes of Transfer
Priority Interrupt
Input-Output Processor
Serial Communication
PERIPHERAL DEVICES
Input Devices Output Devices
1. Keyboard 1. Card Puncher, Paper Tape Puncher
2. Optical input devices 2. CRT
- Card Reader 3. Printer
- Paper Tape Reader 4. (Impact, Ink Jet, Laser, Dot Matrix)
- Bar code reader 5. Plotter
- Digitizer 6. Analog
- Optical Mark Reader 7. Voice
3. Magnetic Input Devices
- Magnetic Stripe Reader
4. Screen Input Devices
- Touch Screen
- Light Pen
- Mouse
5. Analog Input Devices
INPUT/OUTPUT INTERFACE
Provides a method for transferring information between internal storage
(such as memory and CPU registers) and external I/O devices
Resolves the differences between the computer and peripheral devices
Peripherals - Electromechanical Devices
CPU or Memory - Electronic Device
Unit of Information
Peripherals Byte, Block,
CPU or Memory Word
Memory-mapped I/O
- A single set of read/write control lines
(no distinction between memory and I/O transfer)
- Memory and I/O addresses share the common address space
-> reduces memory address range available
- No specific input or output instruction
-> The same memory reference instructions can
be used for I/O transfers
- Considerable flexibility in handling I/O operations
I/O INTERFACE
Programmable Interface
- Information in each port can be assigned a meaning
depending on the mode of operation of the I/O device
Port A = Data; Port B = Command; Port C = Status
- CPU initializes(loads) each port by transferring a byte to the Control Register
Allows CPU can define the mode of operation of each port
Programmable Port: By changing the bits in the control register, it is
possible to change the interface characteristics
ASYNCHRONOUS DATA TRANSFER
Synchronous :
All devices derive the timing information from common clock line
Asynchronous data transfer between two independent units requires that control
signals to be transmitted between the communicating units to indicate the time at which
data is being transmitted
Two Asynchronous Data Transfer Methods:
Strobe pulse :
- A strobe pulse is supplied by one unit to indicate the other unit when the transfer
has to occur
Handshaking:
- A control signal is accompanied with each data being transmitted to indicate the
presence of data
- The receiving unit responds with another control signal to acknowledge receipt of
the data
STROBE CONTROL
A single control line.
The strobe may be activated by either the source or
the destination unit.
Strobe Strobe
HANDSHAKING
Strobe Methods :
Source-Initiated : The source unit that initiates the transfer has no way of
knowing whether the destination unit has actually received data
Timing Diagram :
Source unit
Sequence of Events : Destination unit
Timing Diagram :
Sequence of Events :
ASYNCHRONOUS SERIAL TRANSFER
Asynchronous serial transfer
Four Different Types of Transfer : Synchronous serial transfer
Asynchronous parallel transfer
Synchronous parallel transfer
Asynchronous Serial Transfer
Employs special bits which are inserted at both ends of the character code
Each character consists of three parts: 1)Start bit 2)Data bits 3)Stop bits.
Internal Bus
and clock
Chip select
CS
Register select Status Receiver Receiver CS RS Oper. Register selected
RS Timing clock
register control 0 x x None
I/O read and and clock 1 0 WR Transmitter register
RD
Control 1 1 WR Control register
I/O write Receive 1 0 RD Receiver register
WR Receiver Shift data
1 1 RD Status register
register register
Transmitter Register :
- Accepts a data byte(from CPU) through the data bus
- Transferred to a shift register for serial transmission
Receiver Register:
- Receives serial information into another shift register
- Complete data byte is sent to the receiver register
Status Register Bits :
- Used for I/O flags and for recording errors
Control Register Bits :
- Define baud rate, no. of bits in each character, whether
to generate and check parity, and no. of stop bits
MODES OF TRANSFER
1. Program-Controlled I/O
2. Interrupt-Initiated I/O
3. Direct Memory Access (DMA)
Program-Controlled I/O :
yes
Continue with
program
Modes of Transfer
MODES OF TRANSFER - INTERRUPT INITIATED I/O & DMA
Interrupt Initiated I/O :
- Polling takes valuable CPU time
- Open communication only when some data has to be passed -> Interrupt.
- I/O interface, instead of the CPU, monitors the I/O device
- When the interface determines that the I/O device is ready for data transfer,
it generates an Interrupt Request to the CPU
- Upon detecting an interrupt, 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
Priority in VAD
PI Enable
Vector address
Interrupt Priority out PI RF PO Enable
request RF PO
S Q 0 0 0 0
from device 0 1 0 0
R
1 0 1 0
Delay 1 1 1 1
2
Interrupt
to CPU
3
INTACK
from CPU
IEN: Set or Clear by instructions ION or IOF
IST: Represents an unmasked interrupt has occurred. INTACK enables
tristate Bus Buffer to load VAD generated by the Priority Logic
Interrupt Register:
- Each bit is associated with an Interrupt Request from
different Interrupt Source - different priority level
- Each bit can be cleared by a program instruction
Mask Register:
- Mask Register is associated with Interrupt Register
- Each bit can be set or cleared by an Instruction
Priority Interrupt
Inputs Outputs
I0 I1 I2 I3 x y IST Boolean functions
1 d d d 0 0 1
0 1 d d 0 1 1
0 0 1 d 1 0 1 x = I0' I1'
0 0 0 1 1 1 1 y = I0' I1 + I0 I2
0 0 0 0 d d 0 (IST) = I0 + I1 + I2 + I3
Priority Interrupt
ABUS Address bus
Bus request BR DBUS
High-impedence
Data bus
Bus granted BG
CPU
RD Read
(disabled)
WR Write when BG is
Block diagram of DMA controller : enabled
Address bus
Bus grant BG
Interrupt Interrupt DMA request
DMA acknowledge to I/O device
DMA TRANSFER
Direct Memory Access
Input
[1] Input Device <- R (Read control signal)
[2] Buffer(DMA Controller) <- Input Byte; and
assembles the byte into a word until word is full
[4] M <- memory address, W(Write control signal)
[5] Address Reg <- Address Reg +1; WC(Word Counter) <- WC - 1
[6] If WC = 0, then Interrupt to acknowledge done, else go to [1]
Output
[1] M <- M Address, R
M Address R <- M Address R + 1, WC <- WC - 1
[2] Disassemble the word
[3] Buffer <- One byte; Output Device <- W, for all disassembled bytes
[4] If WC = 0, then Interrupt to acknowledge done, else go to [1]
INPUT/OUTPUT PROCESSOR - CHANNEL -
- Processor with direct memory access capability
that communicates with I/O devices
- Channel accesses memory by cycle stealing
- Channel can execute a Channel Program
- Stored in the main memory
- Consists of Channel Command Word(CCW)
- Each CCW specifies the parameters needed
by the channel to control the I/O devices and
perform data transfer operations
- CPU initiates the channel by executing an
channel I/O class instruction and once initiated,
channel operates independently of the CPU
Input/Output Processor
Pipelining
Arithmetic Pipeline
Instruction Pipeline
RISC Pipeline
Vector Processing
Array Processors
PARALLEL PROCESSING
Execution of Concurrent Events in the computing
process to achieve faster Computational Speed
- Inter-Instruction level
- Intra-Instruction level
PARALLEL COMPUTERS
Architectural Classification
Flynn's classification
Based on the multiplicity of Instruction Streams and Data
Streams
Instruction Stream
Sequence of Instructions read from memory
Data Stream
Operations performed on the data in the processor
Number of Data Streams
Single Multiple
Instruction stream
Characteristics
- Standard von Neumann machine
- Instructions and data are stored in memory
- One operation at a time
Limitations
Von Neumann bottleneck
Maximum speed of the system is limited by the
Memory Bandwidth (bits/sec or bytes/sec)
- Limitation on Memory Bandwidth
- Memory is shared by CPU and I/O
SIMD COMPUTER SYSTEMS
Memory
Data bus
Control Unit
Instruction stream
P P P Processor units
Data stream
Alignment network
M M M Memory modules
Characteristics
M CU P
M CU P Memory
M CU P Data stream
Instruction stream
Characteristics
- There is no computer at present that can be classified as MISD
Parallel Processing
TYPES OF SIMD COMPUTERS
Array Processors
- The control unit broadcasts instructions to all PEs, and all active PEs execute the
same instructions
- ILLIAC IV, GF-11, Connection Machine, DAP, MPP
Systolic Arrays
- Regular arrangement of a large number of very simple processors constructed on
VLSI circuits
- CMU Warp, Purdue CHiP
Associative Processors
- Content addressing
- Data transformation operations over many sets of arguments with a single
instruction
- STARAN, PEPE
MIMD COMPUTER SYSTEMS
P M P M P M
Interconnection Network
Shared Memory
Characteristics
- Multiple processing units
- Message-passing multicomputers
SHARED MEMORY MULTIPROCESSORS
M M M
Buses,
Interconnection Network(IN) Multistage IN,
Crossbar Switch
P P P
Characteristics
All processors have equally direct access to one large memory address
space.
Example systems
Bus and cache-based systems
- Sequent Balance, Encore Multimax
Multistage IN-based systems
- Ultra computer, Butterfly, RP3, HEP
Crossbar switch-based systems
- C.mmp, Alliant FX/8
Limitations
Memory access latency
Hot spot problem
MESSAGE-PASSING MULTICOMPUTER
Message-Passing Network Point-to-point connections
P P P
M M M
Characteristics
- Interconnected computers
- Each processor has its own memory, and
communicate via message-passing
Example systems
- Tree structure: Teradata, DADO
- Mesh-connected: Rediflow, Series 2010, J-Machine
- Hypercube: Cosmic Cube, iPSC, NCUBE, FPS T Series, Mark III
Limitations
- Communication overhead
- Hard to programming
PIPELINING
A technique of decomposing a sequential process into sub operations,
with each sub process being executed in a partial dedicated segment
that operates concurrently with all other segments.
Ai * Bi + Ci for i = 1, 2, 3, ... , 7
Ai Bi Memory Ci
Segment 1
R1 R2
Multiplier
Segment 2
R3 R4
Adder
Segment 3
R5
Clock
Input S1 R1 S2 R2 S3 R3 S4 R4
Space-Time Diagram
1 2 3 4 5 6 7 8 9 Clock cycles
Segment 1 T1 T2 T3 T4 T5 T6
2 T1 T2 T3 T4 T5 T6
3 T1 T2 T3 T4 T5 T6
4 T1 T2 T3 T4 T5 T6
PIPELINE SPEEDUP
n: Number of tasks to be performed
Speedup
Sk: Speedup
Sk = n*tn / (k + n - 1)*tp
tn
lim Sk = ( = k, if tn = k * tp )
n tp
PIPELINE AND MULTIPLE FUNCTION UNITS
Example
- 4-stage pipeline
- subopertion in each stage; tp = 20nS
- 100 tasks to be executed
- 1 task in non-pipelined system; 20*4 = 80nS
Pipelined System
(k + n - 1)*tp = (4 + 99) * 20 = 2060nS
Non-Pipelined System
n*k*tp = 100 * 80 = 8000nS
Speedup
Sk = 8000 / 2060 = 3.88
X = A x 2a R R
Y = B x 2b
Compare Difference
Segment 1: exponents
[1] Compare the exponents by subtraction
R R
R R
4-STAGE FLOATING POINT ADDER
A=ax2 B=bx2
p a q b
p q
Stages: Other
Exponent fraction Fraction
S1 subtractor selector
Fraction with min(p,q)
r = max(p,q)
Right shifter
t = |p - q|
S2 Fraction
adder
r c
Leading zero
S3 counter
c
Left shifter
r
d
Exponent
S4 adder
s d
s
C = A + B = c x 2 = d xr 2
(r = max (p,q), 0.5 d < 1)
INSTRUCTION CYCLE
Six Phases in an Instruction Cycle :
[1] Fetch an instruction from memory
[2] Decode the instruction
[3] Calculate the effective address of the operand
[4] Fetch the operands from memory
[5] Execute the operation
[6] Store the result in the proper place
4-Stage Pipeline
[1] FI: Fetch an instruction from memory
[2] DA: Decode the instruction and calculate
the effective address of the operand
[3] FO: Fetch the operand
[4] EX: Execute the operation
INSTRUCTION PIPELINE
Execution of Three Instructions in a 4-Stage Pipeline
Conventional:
i FI DA FO EX
i+1 FI DA FO EX
i+2 FI DA FO EX
Pipelined :
i FI DA FO EX
i+1 FI DA FO EX
i+2 FI DA FO EX
INSTRUCTION EXECUTION IN A 4-STAGE PIPELINE
Decode instruction
Segment2: and calculate
effective address
yes Branch?
no
Segment3: Fetch operand
from memory
Interrupt yes
Interrupt?
handling
no
Update PC
Example: With one memory-port, a data and an instruction fetch cannot be initiated
in the same clock.
i FI DA FO EX
i+1 FI DA FO EX
Software Technique:
Delayed load : Compiler used to detect the data conflict and re order the
instructions as necessary to delay the loading of the conflict data by inserting the
no operation instructions.
CONTROL HAZARDS
Branch Instructions:
- Branch target address is not known until the branch instruction is
completed
Branch Instruction FI DA FO EX
Next Instruction FI DA FO EX
Vector computer
C(1:100) = A(1:100) + B(1:100)
VECTOR INSTRUCTION FORMAT
Vector Instruction Format
Source
A
DR DR DR DR
Data bus
Address Interleaving
e
Different sets of addresses are assigned to different memory modules