11. Computer Organization and Architecture
11. Computer Organization and Architecture
Module Objective
On completion of the module successfully, students will be able to:
Carry out design and development of complex elements, such as user interfaces,
multiprocessing, and fault-tolerant components;
Describe the basic structure and operation of a digital computer
Explain in detail the operation of the arithmetic unit including the algorithms &
implementation of fixed-point and floating-point addition, subtraction, multiplication &
division.
Identify different ways of communicating with I/O devices and standard I/O interfaces.
Describe different performance enhancement of computer architecture
Explain the basic structure of computer hardware & software
Identify the processes involved in the basic operations of CPU
Demonstrate basic concepts of circuits and their design
2.1. Introduction
Computer organization
Design of the components and functional blocks using which computer systems
are built.
Analogy: civil engineers task during building construction (cement, bricks, iron
rod and other building materials)
Computer Architecture
How to integrate the components to build the computer system to achieve a desire
level of performance?
Analogy: Architects task during the planning of a building (overall layout, floor
plan etc.)
Computer architecture comprises rules, methods, and procedures that describe the execution
and functionality of the entire computer system. In general terms, computer architecture refers to
how a computer system is designed using compatible technologies. This article will tell you how
computer architecture is classified into a disciplinary method.
Page 86 of 248
The term architecture in computer literature signifies the efforts of Sir Lyle R. Johnson and Sir
Frederick P. Brooks, members of the Machine Organization department, in 1959. Sir Johnson
noted his description of formats, instruction types, hardware limitations, along with speed
improvements. These were at the level of system architecture, a term that is more useful than
machine organization. Succeedingly, a computer user can use that term in many less precise
methods.
Earlier, computer architects designed computer architecture on paper. It was then directly built
into a final hardware form. Later, they assembled computer architecture designs materially in the
form of transistor-transistor logic (TTL) computers. By the 1990s, new computer architectures
are typically built, examined, and tweaked inside another computer architecture, in a computer
architecture simulator, or the interior part of an FPGA, as a microprocessor before perpetrating to
the ultimate hardware form.
Page 87 of 248
Input and output mechanisms and peripherals.
The von Neumann design thus constitutes the foundation of modern computing. The Harvard
architecture, a similar model, had committed data addresses and buses for reading and writing to
memory. It wins because von Neumann's architecture was easier to execute in real hardware.
Logic Gates
The logic gates are the main structural part of a digital system.
Logic Gates are a block of hardware that produces signals of binary 1 or 0 when input
logic requirements are satisfied.
Each gate has a distinct graphic symbol, and its operation can be described by means of
algebraic expressions.
The seven basic logic gates include: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
The relationship between the input-output binary variables for each gate can be
represented in tabular form by a truth table.
Each gate has one or two binary input variables designated by A and B and one binary
AND GATE:
o The AND gate is an electronic circuit which gives a high output only if all its inputs are
high. The AND operation is represented by a dot (.) sign.
o output variable designated by x.
OR GATE:
The OR gate is an electronic circuit which gives a high output if one or more of its inputs are
high. The operation performed by an OR gate is represented by a plus (+) sign.
Page 88 of 248
NOT GATE:
The NOT gate is an electronic circuit which produces an inverted version of the input at its
output. It is also known as an Inverter.
NAND GATE:
The NOT-AND (NAND) gate which is equal to an AND gate followed by a NOT gate. The
NAND gate gives a high output if any of the inputs are low. The NAND gate is represented by a
AND gate with a small circle on the output. The small circle represents inversion.
NOR GATE:
The NOT-OR (NOR) gate which is equal to an OR gate followed by a NOT gate. The NOR gate
gives a low output if any of the inputs are high. The NOR gate is represented by an OR gate with
a small circle on the output. The small circle represents inversion.
Page 89 of 248
Exclu
sive-OR/ XOR GATE:
The 'Exclusive-OR' gate is a circuit which will give a high output if one of its inputs is high but
not both of them. The XOR operation is represented by an encircled plus sign.
EXCLUSIVE-NOR/Equivalence GATE:
The 'Exclusive-NOR' gate is a circuit that does the inverse operation to the XOR gate. It will
give a low output if one of its inputs is high but not both of them. The small circle represents
inversion
Page 90 of 248
Basic gates
The OR, AND, and NOT are the three basic logic gates as they together can construct the logic
circuit for any given Boolean expression.
Derived gates
The logic gates which are derived from the basic gates such as AND, OR, NOT gates are called
derived gates. These derived gates have their own unique Symbols, Truth Tables and Boolean
Expressions. Here we will explore the most common derived gates such as NAND Gate, NOR
Gate, EX-OR Gate, and EX-NOR Gate
Universal gate
A universal gate is a gate which can implement any Boolean function without need to use any
other gate type. The NAND and NOR gates are universal gates. In practice, this is advantageous
since NAND and NOR gates are economical and easier to fabricate and are the basic gates used
in all IC digital logic families.
Boolean algebra
Boolean algebra can be considered as an algebra that deals with binary variables and logic
operations. Boolean algebraic variables are designated by letters such as A, B, x, and y. The
basic operations performed are AND, OR, and complement.
The Boolean algebraic functions are mostly expressed with binary variables, logic operation
symbols, parentheses, and equal sign. For a given value of variables, the Boolean function can be
either 1 or 0. For instance, consider the Boolean function:
F = x + y'z
The logic diagram for the Boolean function F = x + y'z can be represented as:
Page 91 of 248
The Boolean function F = x + y'z is transformed from an algebraic expression into a logic
diagram composed of AND, OR, and inverter gates.
Inverter at input 'y' generates its complement y'.
There is an AND gate for the term y'z, and an OR gate is used to combine the two terms
(x and y'z).
The variables of the function are taken to be the inputs of the circuit, and the variable
symbol of the function is taken as the output of the circuit.
The truth table for the Boolean function F = x + y'z can be represented as:
Combinational Circuits
A combinational circuit comprises of logic gates whose outputs at any time are determined
directly from the present combination of inputs without any regard to previous inputs. A
combinational circuit performs a specific information-processing operation fully specified
logically by a set of Boolean functions. The basic components of a combinational circuit are:
input variables, logic gates, and output variables.
Page 92 of 248
In our previous sections, we learned about combinational circuit and their working. The
combinational circuits have set of outputs, which depends only on the present combination of
inputs. Below is the block diagram of the synchronous logic circuit.
Examples of combinational circuits: Adder, Subtractor, Converter, and Encoder/Decoder,
multiplexer/de-multiplexer
The 'n' input variables come from an external source whereas the 'm' output variables go to an
external destination. In many applications, the source or destination are storage registers.
Decoder
The combinational circuit that change the binary information into 2N output lines is known
as Decoders. The binary information is passed in the form of N input lines. The output lines
define the 2N-bit code for the binary information. In simple words, the Decoder performs the
reverse operation of the Encoder. At a time, only one input line is activated for simplicity. The
produced 2N-bit output code is equivalent to the binary information.
Encoders
The combinational circuits that change the binary information into N output lines are known
as Encoders. The binary information is passed in the form of 2N input lines. The output lines
define the N-bit code for the binary information. In simple words, the Encoder performs the
reverse operation of the Decoder. At a time, only one input line is activated for simplicity. The
produced N-bit output code is equivalent to the binary information.
Multiplexer
A multiplexer is a combinational circuit that has 2n input lines and a single output line. Simply,
the multiplexer is a multi-input and single-output combinational circuit. The binary information
is received from the input lines and directed to the output line. On the basis of the values of the
selection lines, one of these data inputs will be connected to the output.
Page 93 of 248
Unlike encoder and decoder, there are n selection lines and 2n input lines. So, there is a total of
2N possible combinations of inputs. A multiplexer is also treated as Mux.
De-multiplexer
A De-multiplexer is a combinational circuit that has only 1 input line and 2N output lines.
Simply, the multiplexer is a single-input and multi-output combinational circuit. The information
is received from the single input lines and directed to the output line. On the basis of the values
of the selection lines, the input will be connected to one of these outputs. De-multiplexer is
opposite to the multiplexer.
Unlike encoder and decoder, there are n selection lines and 2n outputs. So, there is a total of
2n possible combinations of inputs. De-multiplexer is also treated as De-mux.
Sequential circuits
The sequential circuit is a special type of circuit that has a series of inputs and outputs. The
outputs of the sequential circuits depend on both the combination of present inputs and previous
outputs. The previous output is treated as the present state. So, the sequential circuit contains the
combinational circuit and its memory storage elements. A sequential circuit doesn't need to
always contain a combinational circuit. So, the sequential circuit can contain only the memory
element.
Page 94 of 248
Difference between the combinational circuits and sequential circuits are given below:
Sequential circuits refer to the combinational logic circuits that consist of input variables (X)
and logic gates (or Computational circuits) along with the output variable (Z).
For example, flip-flops, counter, register, clocks,
Page 95 of 248
synchronization of the outputs is done with either only negative edges of the clock signal or only
positive edges.
Clock Signal and Triggering
Clock signal
A clock signal is a periodic signal in which ON time and OFF time need not be the same. When
ON time and OFF time of the clock signal are the same, a square wave is used to represent the
clock signal. Below is a diagram which represents the clock signal:
A clock signal is considered as the square wave. Sometimes, the signal stays at logic, either high
5V or low 0V, to an equal amount of time. It repeats with a certain time period, which will be
equal to twice the 'ON time' or 'OFF time'.
Types of Triggering
These are two types of triggering in sequential circuits:
Level triggering
The logic High and logic Low are the two levels in the clock signal. In level triggering, when the
clock pulse is at a particular level, only then the circuit is activated. There are the following types
of level triggering:
Positive level triggering
In a positive level triggering, the signal with Logic High occurs. So, in this triggering, the circuit
is operated with such type of clock signal. Below is the diagram of positive level triggering:
Page 96 of 248
Negative level triggering
In negative level triggering, the signal with Logic Low occurs. So, in this triggering, the circuit is
operated with such type of clock signal. Below is the diagram of Negative level triggering:
Edge triggering
In clock signal of edge triggering, two types of transitions occur, i.e., transition either from Logic
Low to Logic High or Logic High to Logic Low.
Based on the transitions of the clock signal, there are the following types of edge triggering:
Positive edge triggering
The transition from Logic Low to Logic High occurs in the clock signal of positive edge
triggering. So, in positive edge triggering, the circuit is operated with such type of clock signal.
The diagram of positive edge triggering is given below.
Counters
A special type of sequential circuit used to count the pulse is known as a counter, or a collection
of flip flops where the clock signal is applied is known as counters.
Page 97 of 248
The counter is one of the widest applications of the flip flop. Based on the clock pulse, the output
of the counter contains a predefined state. The number of the pulse can be counted using the
output of the counter.
There are the following types of counters:
o Asynchronous Counters
o Synchronous Counters
Asynchronous or ripple counters
The Asynchronous counter is also known as the ripple counter. Below is a diagram of the 2-
bit Asynchronous counter in which we used two T flip-flops. Apart from the T flip flop, we can
also use the JK flip flop by setting both of the inputs to 1 permanently. The external clock pass to
the clock input of the first flip flop, i.e., FF-A and its output, i.e., is passed to clock input of the
next flip flop, i.e., FF-B.
Synchronous counters
In the Asynchronous counter, the present counter's output passes to the input of the next
counter. So, the counters are connected like a chain. The drawback of this system is that it
creates the counting delay, and the propagation delay also occurs during the counting stage.
The synchronous counter is designed to remove this drawback.
In the synchronous counter, the same clock pulse is passed to the clock input of all the flip
flops. The clock signals produced by all the flip flops are the same as each other. Below is the
diagram of a 2-bit synchronous counter in which the inputs of the first flip flop, i.e., FF-A, are
set to 1. So, the first flip flop will work as a toggle flip-flop. The output of the first flip flop is
passed to both the inputs of the next JK flip flop.
Ripple Counter
Ripple counter is a special type of Asynchronous counter in which the clock pulse ripples
through the circuit. The n-MOD ripple counter forms by combining n number of flip-flops. The
n-MOD ripple counter can count 2n states, and then the counter resets to its initial value.
Features of the Ripple Counter:
o Different types of flip flops with different clock pulse are used.
o It is an example of an asynchronous counter.
o The flip flops are used in toggle mode.
o The external clock pulse is applied to only one flip flop. The output of this flip flop is
treated as a clock pulse for the next flip flop.
Page 98 of 248
o In counting sequence, the flip flop in which external clock pulse is passed, act as LSB.
Latches
A Latch is a special type of logical circuit. The latches have low and high two stable states. Due
to these states, latches also refer to as bistable-multivibrators. A latch is a storage device that
holds the data using the feedback lane. The latch stores 1 -bit until the device set to 1. The latch
changes the stored data and constantly trials the inputs when the enable input set to 1.
Based on the enable signal, the circuit works in two states. When the enable input is high, then
both the inputs are low, and when the enable input is low, both the inputs are high.
Page 99 of 248
D (Data or Delay) flip-flop.
D flip flop is a widely used flip flop in digital systems. The D flip flop is mostly used in shift-
registers, counters, and input synchronization.
T (Toggle) flip-flop.
Just like JK flip-flop, T flip flop is used. Unlike JK flip flop, in T flip flop, there is only single
input with the clock input. The T flip flop is constructed by connecting both of the inputs of JK
flip flop together as a single input.
Examples:
(10100)2, (11011)2, (11001)2, (000101)2, (011010)2.
Decimal Number System
The decimal numbers are used in our day to day life. The decimal number system contains ten
digits from 0 to 9(base 10). Here, the successive place value or position, left to the decimal point
holds units, tens, hundreds, thousands, and so on.
The position in the decimal number system specifies the power of the base (10). The 0 is the
minimum value of the digit, and 9 is the maximum value of the digit. For example, the decimal
number 2541 consist of the digit 1 in the unit position, 4 in the tens position, 5 in the hundreds
position, and 2 in the thousand positions and the value will be written as:
(2×1000) + (5×100) + (4×10) + (1×1)
(2×103) + (5×102) + (4×101) + (1×100)
2000 + 500 + 40 + 1
2541
Octal Number System
The octal number system has base 8(means it has only eight digits from 0 to 7). There are only
eight possible digit values to represent a number. With the help of only three bits, an octal
number is represented. Each set of bits has a distinct value between 0 and 7.
Below, we have described certain characteristics of the octal number system:
Characteristics:
1. An octal number system carries eight digits starting from 0, 1, 2, 3, 4, 5, 6, and 7.
2. It is also known as the base 8 number system.
3. The position of a digit represents the 0 power of the base (8). Example: 80
4. The position of the last digit represents the x power of the base (8). Example: 8x, where x
represents the last position, i.e., 1
(0.25)10 = (.01)2
Decimal to Octal Conversion
For converting decimal to octal, there are two steps required to perform, which are as follows:
1. In the first step, we perform the division operation on the integer and the successive quotient
with the base of octal(8).
2. Next, we perform the multiplication on the integer and the successive quotient with the base
of octal (8).
Example 1: (152.25)10
Step 1:
Divide the number 152 and its successive quotients with base 8.
The microoperations most often encountered in digital computers are classified into four
categories:
Register transfer microoperations
Arithmetic microoperations (on numeric data stored in the registers)
Logic microoperations (bit manipulations on non-numeric data)
Shift microoperations
Flynn's Classification of Computers
M.J. Flynn proposed a classification for the organization of a computer system by the number of
instructions and data items that are manipulated simultaneously.
The sequence of instructions read from memory constitutes an instruction stream.
The operations performed on the data in the processor constitute a data stream.
Flynn's classification divides computers into four major groups that are:
1. Single instruction stream, single data stream (SISD)
2. Single instruction stream, multiple data stream (SIMD)
3. Multiple instruction stream, single data stream (MISD)
4. Multiple instruction stream, multiple data stream (MIMD)
Flynn's classification of Computers