III CS Computer System Architecture Notes
III CS Computer System Architecture Notes
UNIT-1
Input Output
Input-Output Processor Devices
Devices
The hardware of the computer is usually divided into three major parts.
The Central processing Unit (CPU) contains an arithmetic and logic unit for
manipulating data, a number of registers for storing data and control circuits for
fetching and executing instructions.
The memory of a computer contains storage for instructions and data, it is called a
Random Access Memory (RAM) because the CPU can access any location in
memory at random and retrieve the binary information within a fixed interval of
time.
The input and output processor contains electronic circuit for communication and
controlling the transfer of information between the computer and the outside world.
The input and output device connected to the computer include keyboards, printers,
terminals, magnetic disk drives and other communication devices.
LOGICAL GATES
Basic Gates
AND Gate:
In this type of gate output is high only when all its inputs are high.
If any single input is law then the output will remain low.
So it is said that in AND gate the output is only high when the input is also high.
SYMBOL:
TRUTH-TABLE:
INPUT OUTPU
T
A B A AND
B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate:
In this type of gate if any input signal is high then the output will be high.
The output is only low only when all the inputs are low
SYMBOL:
TRUTH-TABLE:
INPUT OUTPU
T
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
NOT Gate:
This type of gate is also known as “Inverter”.
It is a gate that contains only one input and only one output.
The output is always opposite than the input signals.
SYMBOL:
TRUTH-TABLE:
INPUT OUTPU
T
A NOT
A
(A’)
0 1
1 0
Universal Gates
NAND and NOR gates are known as universal gates because we can
construct any gate using NAND & NOR
gate.
NOR Gate:
The NOR gate is the complement of the OR gate.
As shown in the truth table that the output of NOR gate is exactly opposite than the
output of OR gate.
This means that the output will be high when all the input is low.
SYMBOL:
TRUTH-TABLE:
INPUT OUTPU
T
A B A NOR
B
0 0 1
0 1 0
1 0 0
1 1 0
NAND Gate:
The NAND gate is an AND gate followed by NOT gate.
As shown in the truth table that the output of NAND gate is exactly opposite than
the output of AND gate.
This means that the output will be high when all the input is high.
SYMBOL:
TRUTH-TABLE:
INPUT OUTPUT
A B A NAND
B
0 0 1
0 1 1
1 0 1
1 1 0
Exclusive Gates
EX-OR Gate:
This gate is produces high output whenever the two inputs are at opposite level.
The EX-OR gate is the gate that produces high output for Odd number of high inputs.
SYMBOL:
TRUTH-TABLE:
INPUT OUTPUT
A B A EX-OR B
0 0 0
0 1 1
1 0 1
1 1 0
EX-NOR Gate:
This gate is produces high output whenever the two inputs are at same level.
The EX-OR gate is the gate that produces high output for Even number of high inputs.
The truth table shows that output of this gate is exactly opposite of EX-OR gate.
SYMBOL:
TRUTH-TABLE:
INPUT OUTPUT
A B A EX-NOR
B
0 0 1
0 1 0
1 0 0
1 1 1
Combinational Logic Circuits
Arithmetic circuits:
It is made of different arithmetic operators. There will be addition, substraction,
division, modules and any other arithmetic operations.
Half-Adder
Flip Flops
What is Flip-flops
SR Flip-Flop (SET-RESET)
JK Flip-Flop (MASTER SLAVE)
D Flip-Flop (DELAY)
T Flip-Flop (TOGGLE)
SR Flip-Flop
Inputs:
S (for set)
R (for reset)
C (for clock)
Outputs:
Q
Q'
If there is no signal at the clock input C, the output of the circuit cannot
change irrespective of the values at inputs S and R.
Only when the clock signals changes from 0 to 1 can the output be affected
according to the values in inputs S and R
If S =1 and R = 0 when C changes when C changes from 0 to 1 output Q is set to 1.
If S = 0 and R =1 when C changes from 0 to 1.
If both S and R are 0 during the clock transition, output does not change.
When both S and R are equal to 1, the output is unpredictable and may go to either
0 or 1, depending on internal timing that occur within the circuit.
JK Flip-Flop
Inputs:
J
K
C (for clock)
Outputs:
Q
Q'
D Flip-Flop
Inputs:
D (for data)
C (for clock)
Outputs:
Q
Q'
The operation of the D flip-flop is as follow.
T Flip-Flop
Inputs:
T (for toggle)
C (for clock)
Outputs:
Q
Q'
1 0 0 1
1 1 X 0
JK Flip-Flop Excitation
Table
Q(n Q(n+ J K
) 1)
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
D Flip-Flop Excitation
Table
Q(t) Q(t+1 D
)
0 0 0
0 1 1
1 0 0
1 1 1
T Flip-Flop Excitation
Table
Q(t) Q(t+1 T
)
0 0 0
0 1 1
1 0 1
1 1 0
Fixed point numbers are also known as whole numbers or Integers. The number of bits used
in representing the integer also implies the maximum number that can be represented in the system
hardware.
In addition to the bit length definition for integers, we also have a choice to represent them as
below:
Unsigned Integer: A positive number including zero can be represented in this format. All
the allotted bits are utilised in defining the number. So if one is using 8 bits to represent the
unsigned integer, the range of values that can be represented is 28 i.e. "0" to "255". If 16 bits
are used for representing then the range is 216 i.e. "0 to 65535".
Signed Integer: In this format negative numbers, zero, and positive numbers can be
represented. A sign bit indicates the magnitude direction as positive or negative. There are
three possible representations for signed integer and these are Sign Magnitude format, 1's
Compliment format and 2's Complement format.
Signed Integer – Sign Magnitude format: Most Significant Bit (MSB) is reserved for indicating
the direction of the magnitude (value). A "0" on MSB means a positive number and a "1" on MSB
means a negative number. If n bits are used for representation, n-1 bits indicate the absolute value of
the number. Examples for n=8:
0 0 0000
1 1 0001
2 10 0010
3 11 0011
4 100 0100
5 101 0101
6 110 0110
7 111 0111
8 1000 1000
9 1001 1001
As per the above expression all the decimal numbers written in the 4 Bit binary code in the
form of 8421 and this is called as 8421 Code and also as Binary coded decimal BCD.
As this is a straight code, any Decimal number can be expressed easily because the weights of
the positions are straight for easy conversion into this 8421 code.
There are other forms of codes which are not so popular but rather confusing. They are 2421 code,
5211 code, reflective code, sequential code, non- weighted coded, excess-3 code and Grey code.
They are having their own importance for some of the exclusive applications and may be useful for
some of the special applications.
2421 Code
This code also a 4 bit application code where the binary weights carry 2, 4, 2, 1 from left to right.
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
DECIMAL NUMBER BINARY NUMBER
8 1000
9 1001
Excess-3 code
The Excess-3 code is also called as XS-3 code. It is non-weighted code used to express decimal
numbers. The Excess-3 code words are derived from the 8421 BCD code words adding (0011)2 or
(3)10 to each code word in 8421. The excess-3 codes are obtained as follows −
Example
Gray Code
It is the non-weighted code and it is not arithmetic codes. That means there are no specific weights
assigned to the bit position. It has a very special feature that, only one bit will change each time the
decimal number is incremented as shown in fig. As only one bit changes at a time, the gray code is
called as a unit distance code. The gray code is a cyclic code. Gray code cannot be used for
arithmetic operation.
Parity Bit
A parity bit is an extra bit included with a binary message to make the total number
of 1’s either odd or even.
Generally there are 2 techniques even and odd parity is used.
In even parity bit the sum of all 1’s is even while in odd parity the sum of all 1’s is odd.
For e.g. for three bit message has two possible parity shown in below table.
Message P(odd) P(even)
Xyx
000 1 0
001 0 1
010 0 1
011 1 0
100 0 1
101 1 0
110 1 0
111 0 1