COA Notes
COA Notes
A Digital computer can be considered as a digital system that performs various computational tasks.
The first electronic digital computer was developed in the late 1940s and was used primarily for numerical
computations.
By convention, the digital computers use the binary number system, which has two digits: 0 and 1. A binary
digit is called a bit.
A computer system is subdivided into two functional entities: Hardware and Software.
The hardware consists of all the electronic components and electromechanical devices that comprise the
physical entity of the device.
The software of the computer consists of the instructions and data that the computer manipulates to perform
various data-processing tasks.
o The Central Processing Unit (CPU) contains an arithmetic and logic unit for manipulating data, a
number of registers for storing data, and a control circuit for fetching and executing instructions.
o The memory unit of a digital computer contains storage for instructions and data.
o The Random Access Memory (RAM) for real-time processing of the data.
o The Input-Output devices for generating inputs from the user and displaying the final results to the
user.
o The Input-Output devices connected to the computer include the keyboard, mouse, terminals,
magnetic disk drives, and other communication devices.
Interconnection between Functional Components
A computer consists of input unit that takes input, a CPU that processes the input and an output unit that
produces output. All these devices communicate with each other through a common bus. A bus is a
transmission path, made of a set of conducting wires over which data or information in the form of electric
signals is passed from one component to another in a computer. The bus can be of three types – Address
bus, Data bus and Control Bus.
Computer Architecture:
Computer Architecture is concerned with the way hardware components are connected together to
form a computer system.
A programmer
mer can view architecture in terms of instructions, addressing modes and registers.
Architecture involves Logic (Instruction sets, Addressing modes, Data types, Cache optimization)
Computer Organization:
Computer Organization is concerned with the structure and behavior of a computer system as seen by
the user.
Computer Organization tells us how exactly all the units in the system are arranged and interconnected.
Whereas Organization expresses the realization of architecture.
Computer Design:
Computer Design is the structure in which components relate to each other. The designer deals with a
particular level of system at a time and there are different types of issues at different levels. At each level,
the designer is concerned with the structure and function. The structure is the skeleton of the various
components related to each other for communication. The function is the activities involved in the system.
Following are the issues in computer design:
Logic Gates
o The logic gates are the main structural part of a digital system.
o Logic Gates are a block of hardware that produces signals of binary 1 or 0 when input logic requirements
are satisfied.
o Each gate has a distinct graphic symbol, and its operation can be described by means of algebraic
expressions.
o The seven basic logic gates includes: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
o The relationship between the input-output binary variables for each gate can be represented in tabular
form by a truth table.
o Each gate has one or two binary input variables designated by A and B and one binary output variable
designated by x.
AND GATE:
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.
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.
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.
Exclusive-OR/ XOR
OR GATE:
The 'Exclusive-OR'
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
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.
Flip-Flop:
The design of these flip flops also includes two inputs, called the SET [S] and RESET [R]. There are also two
outputs, Q and Q'.
Clocked S-R Flip-Flop
Registers are a type of computer memory used to quickly accept, store, and transfer data and instructions that
are being used immediately by the CPU. The registers used by the CPU are often termed as Processor
registers.
A processor register may hold an instruction, a storage address, or any data (such as bit sequence or individual
characters).
The computer needs processor registers for manipulating data and a register for holding a memory address.
The register holding the memory location is used to calculate the address of the next instruction after the
execution of the current instruction is completed.
Following is the list of some of the most common registers used in a basic computer:
The following image shows the register and memory configuration for a basic computer.
o The Memory unit has a capacity of 4096 words, and each word contains 16 bits.
o The Data Register (DR) contains 16 bits which hold the operand read from the memory location.
o The Memory Address Register (MAR) contains 12 bits which hold the address for the memory
location.
o The Program Counter (PC) also contains 12 bits which hold the address of the next instruction to be
read from memory after the current instruction is executed.
o The Accumulator (AC) register is a general purpose processing register.
o The instruction read from memory is placed in the Instruction register (IR).
o The Temporary Register (TR) is used for holding the temporary data during the processing.
o The Input Registers (IR) holds the input characters given by the user.
o The Output Registers (OR) holds the output after processing the input data.
Register Transfer
Registers define the storage area that influences the data and instructions. It can send data and instructions
from one register to another register, memory to register, and memory to memory, the register transfer
approach is used. This register is used in the transmission of data and instructions between memory and
processors to implement the particular tasks.
The data transfer from one register to another is named in representative design using a replacement operator.
The statement is
R2←R1
It indicates a transfer of the content of register R1 into register R2. It labeled a replacement of the content of
R2 by the content of R1. The content of the source register R1 does not shift after the transfer.
A statement that specifies a register transfer involves that circuits are accessible from the outputs of the source
register to the inputs of the destination register and that the destination register has a corresponding load
efficiency.
We need the transfer to appear only under a fixed control condition. This can be displayed using an if-then
statement.
Where P is a control signal created in the control area. A control function is a Boolean variable that is similar
to 1 or 0. The control function is contained in the statement as follows −
P: R2 ← R1
The control condition is terminated with a colon. It represents the specification that the transfer operation is
implemented by the hardware only if P = 1. Each statement written in a register transfer notation indicates a
hardware structure for executing the transfer.
The diagram demonstrates the block diagram that shows the transfer from R1 to R2. The n outputs of register
R1 are linked to the n inputs of register R2. The letter n can denote any number of bits for the register. It will
be restored by an actual number when the duration of the register is established.
Register R2 has a load input that is activated by the control variable P. It is considered that the control variable
is synchronized with the equivalent clock like the one used to the register.
As displayed in the timing diagram, P is activated in the control area by the increasing edge of a clock pulse at
time t. The next positive transition of the clock at time t + 1 discovers the load input active and the data inputs
of R2 are then loaded into the register in parallel. P can go back to 0 at time t + 1. The transfer will appear
with each clock pulse transition while P stays active.
The clock is not contained as a variable in the register transfer statements. It is considered that all transfers
appear during a clock edge transition. The control condition including P becomes active only after time t, the
actual transfer does not appear until the register is triggered by the next positive transition of the clock at time
t + 1.
R1(8-bit)
() Denotes a part of register
R1(0-7)
R1 <- R2
, Specify two micro-operations
micro of Register Transfer
R2 <- R1
P : R2 <- R1
: Denotes conditional operations
if P=1
Naming Operator (:=) Denotes another name for an already existing register/alias Ra := R1
Multiplexers:
A Multiplexer (MUX) can be described as a combinational circuit that receives binary information from one
of the 2^n input data lines and directs it to a single output line.
The selection of a particular input data line for the output is decided on the basis of selection lines.
The multiplexer is often called as data selector since it selects only one of many data inputs.
Note: A 2^n-to-11 multiplexer has 2^n input data lines and n input selection
selection lines whose bit combinations
determine which input data are selected for the output.
Out of these four input data lines, a particular input data line will be connected to the output based on the
combination of inputs present at these two selection lines.
Note: A truth table describing the circuit needs 64 rows since six input variables can have 2^n binary
combinations. This will result in an excessively long table. Therefore, a more convenient way to describe the
operation of multiplexers is using a function table.
S1 S0 y
0 0 I0
0 1 I1
1 0 I2
1 1 13
A digital system composed of many registers, and paths must be provided to transfer information from one
register to another. The number of wires connecting all of the registers will be excessive if separate lines are
used between each register and all other registers in the system.
A bus structure, on the other hand, is more efficient for transferring information between registers in a multi-
register configuration system.
A bus consists of a set of common lines, one for each bit of register, through which binary information is
transferred one at a time. Control signals determine which register is selected by the bus during a particular
register transfer.
The following block diagram shows a Bus system for four registers. It is constructed with the help of four 4 *
1 Multiplexers each having four data inputs (0 through 3) and two selection inputs (S1 and S2).
We have used labels to make it more convenient for you to understand the input-output configuration of a Bus
system for four registers. For instance, output 1 of register A is connected to input 0 of MUX1.
The two selection lines S1 and S2 are connected to the selection inputs of all four multiplexers. The selection
lines choose the four bits of one register and transfer them into the four-line
four common bus.
When both of the select lines are at low logic, i.e. S1S0 = 00, the 0 data inputs of all four multiplexers are
selected and applied to the outputs that forms the bus. This, in turn, causes the bus lines to receive the content
of register A since the outputs of this register are connected
connected to the 0 data inputs of the multiplexers.
Similarly, when S1S0 = 01, register B is selected, and the bus lines will receive the content provided by
register B.
The following function table shows the register that is selected by the bus for each of the four
f possible binary
values of the Selection lines.
A bus system can also be constructed using three-state gates instead of multiplexers.
The three state gates can be considered as a digital circuit that has three gates, two of which are signals
equivalent to logic 1 and 0 as in a conventional gate. However, the third gate exhibits a high-impedance state.
The most commonly used three state gates in case of the bus system is a buffer gate.
The following diagram demonstrates the construction of a bus system with three-state buffers.
o The outputs generated by the four buffers are connected to form a single bus line.
o Only one buffer can be in active state at a given point of time.
o The control inputs to the buffers determine which of the four normal inputs will communicate with
the bus line.
o A 2 * 4 decoder ensures that no more than one control input is active at any given point of time.
Memory Transfer
Most of the standard notations used for specifying operations on memory transfer are stated below.
o The transfer of information from a memory unit to the user end is called a Read operation.
o The transfer of new information to be stored in the memory is called a Write operation.
o A memory word is designated by the letter M.
o We must specify the address of memory word while writing the memory transfer operations.
o The address register is designated by AR and the data register by DR.
o Thus, a read operation can be stated as:
1. Read: DR ← M [AR]
o The Read statement causes a transfer of information into the data register (DR) from the memory
word (M) selected by the address register (AR).
o And the corresponding write operation can be stated as:
1. Write: M [AR] ← R1
o The Write statement causes a transfer of information from register R1 into the memory word (M)
selected by address register (AR).
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.
The basic components of a combinational circuit are: input variables, logic gates, and output variables.
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 is storage registers.
The combinational circuit that performs the addition of two bits is called a half adder and the one that
performs the addition of three bits (two significant bits and a previous carry) is a full adder.
Half – Adder:
A Half-adder
adder circuit needs two binary inputs and two binary outputs. The input variable shows the
t augend and
addend bits whereas the output variable produces the sum and carry. We can understand the function of a half
half-
adder by formulating a truth table. The truth table for a half
half-adder is:
o 'x' and 'y' are the two inputs, and S (Sum) and C (Carry) are the two outputs.
o The Carry output is '0' unless both the inputs are 1.
o 'S' represents the least significant bit of the sum.
S = x'y+xy', C = xy
Full – Adder:
This circuit needs three binary inputs and two binary outputs. The truth table for a full
full-adder
adder is:
o Two of the input variable 'x' and 'y', represent the two significant bits to be added.
o The third input variable 'z', represents the carry from the previous lower significant position.
o The outputs are designated by the symbol 'S' for sum and 'C' for carry.
o The eight rows under the input variables designate all possible combinations of 0's, and 1's that these
variables may have.
o The input-output
output logical relationship of the full-adder
full adder circuit may be expressed in two Boolean
functions, one for each output variable.
o Each output Boolean function can be simplified by using a unique map method.
The logic diagram for a full-adder
adder circuit can be represented as:
Arithmetic Micro-operations
operations:
1. Addition
2. Subtraction
3. Increment
4. Decrement
5. Shift
1. Binary Adder
The Add micro-operation requires registers that can hold the data and the digital components that can perform
the arithmetic addition.
A Binary Adder is a digital circuit that performs the arithmetic sum of two binary numbers provided with any
length.
A Binary Adder is constructed using full-adder circuits connected in series, with the output carry from one
full-adder connected to the input carry of the next full-adder.
The following block diagram shows the interconnections of four full-adder circuits to provide a 4-bit binary
adder.
o The augend bits (A) and the addend bits (B) are designated by subscript numbers from right to left,
with subscript '0' denoting the low-order bit.
o The carry inputs starts from C0 to C3 connected in a chain through the full-adders. C4 is the resultant
output carry generated by the last full-adder circuit.
o The output carry from each full-adder is connected to the input carry of the next-high-order full-adder.
o The sum outputs (S0 to S3) generates the required arithmetic sum of augend and addend bits.
o The n data bits for the A and B inputs come from different source registers. For instance, data bits
for A input comes from source register R1 and data bits for B input comes from source register R2.
o The arithmetic sum of the data inputs of A and B can be transferred to a third register or to one of the
source registers (R1 or R2).
Binary Adder-Subtractor
The Subtraction micro-operation can be done easily by taking the 2's compliment of addend bits and adding it
to the augend bits.
The Arithmetic micro-operations like addition and subtraction can be combined into one common circuit by
including an exclusive-OR gate with each full adder.
The block diagram for a 4-bit adder-subtractor circuit can be represented as:
o When the mode input (M) is at a low logic, i.e. '0', the circuit act as an adder and when the mode input
is at a high logic, i.e. '1', the circuit act as a subtractor.
o The exclusive-OR gate connected in series receives input M and one of the inputs B.
o When M is at a low logic, we have B⊕ 0 = B.
The full-adders receive the value of B, the input carry is 0, and the circuit performs A plus B.
o When M is at a high logic, we have B⊕ 1 = B' and C0 = 1.
The B inputs are complemented, and a 1 is added through the input carry. The circuit performs the
operation A plus the 2's complement of B.
Binary Incrementer
The increment micro-operation adds one binary value to the value of binary variables stored in a register. For
instance, a 4-bit register has a binary value 0110, when incremented by one the value becomes 0111.
The increment micro-operation is best implemented by a 4-bit combinational circuit incrementer. A 4-bit
combinational circuit incrementer can be represented by the following block diagram.
o A logic-1 is applied to one of the inputs of least significant half-adder, and the other input is
connected to the least significant bit of the number to be incremented.
o The output carry from one half-adder is connected to one of the inputs of the next-higher-order half-
adder.
o The binary incrementer circuit receives the four bits from A0 through A3, adds one to it, and
generates the incremented output in S0 through S3.
o The output carry C4 will be 1 only after incrementing binary 1111.
Hardware Implementation of arithmetic circuits
Logic Micro-operations:
There are 16 different logic operations that can be performed with two binary variables.
They can be determined from all possible truth tables obtained with two binary variables as shown
in Table below.
In this table, each of the 16 columns F0 through F15 represents a truth table of one possible Boolean
function for the two variables x and y.
Note that the functions are determined from the 16 binary combinations that can be assigned to F.
The 16 Boolean functions of two variables x and y are expressed in algebraic form in the first column
of Table below.
The 16 logic micro-operations are derived from these functions by replacing variable x by the binary
content of register A and variable y by the binary content of register B.
It is important to realize that the Boolean functions listed in the first column of Table below
represent a relationship between two binary variables x and y.
The logic micro-operations listed in the second column represent a relationship between the binary
content of two registers A and B.
Each bit of the register is treated as a binary variable and the micro-operation is performed on the
string of bits stored in the registers.
Hardware Implementation:
The hardware implementation of logic rnicrooperations requires that logic gates be inserted for
each bit or pair of bits in the registers to perform the required logic function.
Although there are 16 logic rnicrooperations, most computers use only four-AND, OR, XOR
(exclusive-OR), and complement from which all others can be derived.
Figure below shows one stage of a circuit that generates the four basic logic rnicrooperations .
It consists of four gates and a multiplexer. Each of the four logic operations is generated through a
gate that performs the required logic.
The outputs of the gates are applied to the data inputs of the multiplexer. The two selection inputs
S1 and S0 choose one of the data inputs of the multiplexer and direct its value to the output.
The diagram shows one typical stage with subscript i. For a logic circuit with n bits, the diagram
must be repeated n times for i = 0, 1, 2, ... , n - 1.
The selection variables are applied to all stages. The function table in Fig. below lists the logic
rnicro-operations obtained for each combination of the selection variables.
Shift Micro-Operations:
Shift micro-operations are those micro-operations that are used for the serial transfer of information. These
are also used in conjunction with arithmetic micro-operation, logic micro-operation, and other data-
processing operations. There are three types of shift micro-operations: 1.
1. Logical Shift:
It transfers the 0 zero through the serial input. We use the symbols ‘<<‘ for the logical left shift and ‘>>‘ for
the logical right shift.
Logical Left Shift:
In this shift, one position moves each bit to the left one by one. The Empty least significant bit (LSB) is filled
with zero (i.e, the serial input), and the most significant bit (MSB) is rejected.
The left shift operator is denoted by the double left arrow key (<<). The general syntax for the left shift is
shift-expression << k.
Logical Left Shift
Note: Every time we shift a number towards the left by 1 bit it multiplies that number by 2.
The right shift operator is denoted by the double right arrow key (>>). The general syntax for the right shift
is “shift-expression >> k”.
Note: Every time we shift a number towards the right by 1 bit it divides that number by 2.
2. Arithmetic Shift:
The arithmetic shift micro-operation moves the signed binary number either to the left or to the
right position.
Following are the two ways to perform the arithmetic shift.
3. Circular Shift:
The circular shift circulates the bits in the sequence of the register around both ends without any
loss of information.
Following are the two ways to perform the circular shift.
Arithmetic Logic Shift Unit (ALSU): is a member of the Arithmetic Logic Unit
(ALU) in a computer system. It is a digital circuit that performs logical, arithmetic, and shift
operations. Rather than having individual registers calculating the micro operations directly, the
computer deploys a number of storage registers which is connected to a common operational unit
known as an arithmetic logic unit or ALU.
Now, to implement the micro operation, the contents of specified registers are allocated in the
inputs of the common Arithmetic Logic Unit. The Arithmetic Logic Unit performs an operation that
leads as a result and gets transferred to a destination register. Arithmetic Logic Unit may be a
combinatory circuit in order that the complete register transfer operation from the supply registers
through the ALU and into the destination register is performed throughout one clock pulse amount.
Sometimes, the shift micro operations are performed in a separate unit, but sometimes it is made as
a part of full ALU.
The below table shows the 14 operations perform by the Arithmetic Logic Unit: