CO UNIT - 1
CO UNIT - 1
There are a few basic components that aids the working-cycle of a computer i.e. the Input- Process-
Output Cycle and these are called as the functional components of a computer. It needs certain
input, processes that input and produces the desired output. The input unit takes the input, the
central processing unit does the processing of data and the output unit produces the output. The
memory unit holds the data and instructions during the processing.
• Input Unit :The input unit consists of input devices that are attached to
the computer. These devices take input and convert it into binary
language that the computer understands. Some of the common input
devices are keyboard, mouse, joystick, scanner etc.
• Central Processing Unit (CPU) : Once the information is entered into
the computer by the input device, the processor processes it. The CPU is
called the brain of the computer because it is the control center of the
computer. It first fetches instructions from memory and then interprets
them so as to know what is to be done. If required, data is fetched from
memory or input device. Thereafter CPU executes or performs the
required computation and then either stores the output or displays on the
output device. The CPU has three main components which are
responsible for different functions – Arithmetic Logic Unit (ALU), Control
Unit (CU) and Memory registers
• Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests
performs mathematical calculations and takes logical decisions.
Arithmetic calculations include addition, subtraction, multiplication and
division. Logical decisions involve comparison of two data items to see
which one is larger or smaller or equal.
• Control Unit : The Control unit coordinates and controls the data flow in
and out of CPU and also controls all the operations of ALU, memory
registers and also input/output units. It is also responsible for carrying out
all the instructions stored in the program. It decodes the fetched
instruction, interprets it and sends control signals to input/output devices
until the required operation is done properly by ALU and memory.
• Memory Registers : A register is a temporary unit of memory in the CPU.
These are used to store the data which is directly used by the processor.
Registers can be of different sizes(16 bit, 32 bit, 64 bit and so on) and
each register inside the CPU has a specific function like storing data,
storing an instruction, storing address of a location in memory etc. The
user registers can be used by an assembly language programmer for
storing operands, intermediate results etc. Accumulator (ACC) is the main
register in the ALU and contains one of the operands of an operation to
be performed in the ALU.
• Memory : Memory attached to the CPU is used for storage of data and
instructions and is called internal memory The internal memory is divided
into many storage locations, each of which can store data or instructions.
Each memory location is of the same size and has an address. With the
help of the address, the computer can read any memory location easily
without having to search the entire memory. when a program is executed,
it’s data is copied to the internal memory and is stored in the memory till
the end of the execution. The internal memory is also called the Primary
memory or Main memory. This memory is also called as RAM, i.e.
Random Access Memory. The time of access of data is independent of its
location in memory, therefore this memory is also called Random Access
memory (RAM).
• Output Unit : The output unit consists of output devices that are attached
with the computer. It converts the binary data coming from CPU to human
understandable form. The common output devices are monitor, printer,
plotter etc.
Introduction
Computer design is the process of planning and creating the hardware and
software components of a computer system. This involves defining the
architecture and specifications of the system, as well as selecting and
implementing the appropriate technologies and components to meet the
desired goals and requirements. Computer design encompasses both the
functional and aesthetic aspects of a computer system, with the ultimate goal
of creating a functional, efficient, and user-friendly computing device.
Computer Architecture can be divided into mainly three categories, which are
as follows −
Computer Computer
Architecture Organization
Concerned with the way hardware Concerned with the structure and
components are behaviour of a
connected together to form a computer system as seen by the
computer system. user.
Acts as the interface between Deals with the components of a
hardware and software. connection in a system.
• The ISA acts as an interface between the hardware and the software,
specifying both what the processor is capable of doing as well as how
it gets done.
C = A + B;
in all 3 architectures:
Stack Accumulator GPR
• POP C - -
• Addressing Modes
• Addressing Memory
Register
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.
For example, the register that holds an address for the memory unit is
usually called a memory address register and is designated by the name
MAR
Micro operation
• The result of the operation may replace the previous binary information
of a register or may be transferred to another register.
Representation of register
1. a rectangular box with the name of the register inside as shown in (a).
2. Register is numbered in a sequence of 0 to (n-1) as shown in (b).
3. The numbering of bits in a register can be marked on the top of the box
as shown in (c).
4. A 16-bit register PC is divided into 2 parts- Bits (0 to 7) are assigned with
lower byte of 16-bit address and bits (8 to 15) are assigned with higher
bytes of 16-bit address as shown in (d).
Basic symbols of RTL
Register Transfer
The term Register Transfer refers to the availability of hardware logic circuits that can
perform a given micro-operation and transfer the result of the operation to the same
or another register.
Data Transfer from one register to another register is represented in symbolic form by
means of replacement operator. For instance, the following statement denotes a
transfer of the data of register R1 into register R2.
R2 ← R1
The operation performed on the data stored in the registers are referred to as
register transfer operations.
There are different types of register transfer operations:
• The content of R1 are copied into R2 without affecting the content of R1. It
is an unconditional type of transfer operation.
2. Conditional Transfer – P: R2 ← R1
• Here, the letter 'n' indicates the number of bits for the register. The 'n' outputs
of the register R1 are connected to the 'n' inputs of register R2.
• A load input is activated by the control variable 'P' which is transferred to the
register R2.
3. Simultaneous Operations –
If 2 or more operations are to occur simultaneously then they are separated with
comma (,). If the control function P=1, then load the content of R1 into R2 and at
the same clock load the content of R2 into R1.
MICRO OPERATIONS
1. Addition
2. Subtraction
3. Increment
4. Decrement
5. Shift
To implement this statement with hardware we need three registers and the
digital component that performs the addition operation.
Binary adder
• A Binary Adder is a digital circuit that performs the arithmetic sum of two
binary numbers provided with any length.
• 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.
• 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.
• The output carry from each full-adder is connected to the input carry of the
next-high-order full-adder.
• The sum outputs (S0 to S3) generates the required arithmetic sum of
augend and addend bits.
• 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.
Binary Adder-Subtractor
• Note: The 2's compliment can be obtained by taking the 1's compliment
and adding one to the least significant pair of bits. The 1's compliment can
be implemented with inverters, and one can be added to the sum through
the input carry.
• 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.
• The exclusive-OR gate connected in series receives input M and one of
the inputs B.
Binary Incrementer
• The output carry from one half-adder is connected to one of the inputs of
the next-higher-order half-adder.
• 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.
Arithmetic circuit
• Shift micro-operations are those micro-operations that are used for serial
transfer of information.
1. Logical
2. Circular
3. Arithmetic
Instruction Codes
Computer Registers
Accumulator AC 16 Processor
register
Instruction IR 16 Holds
register instruction code
Temporary TR 16 Holds
register temporary data
• The Data Register (DR) contains 16 bits which hold the operand read from
the memory location.
• The Memory Address Register (MAR) contains 12 bits which hold the
address for the memory location.
• 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.
• The instruction read from memory is placed in the Instruction register (IR).
• The Temporary Register (TR) is used for holding the temporary data during
the processing.
• The Input Registers (IR) holds the input characters given by the user.
• The Output Registers (OR) holds the output after processing the input data.
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.
• The number of wires will be excessive if connections are made between the
outputs of each register and the inputs of the other 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. above. The outputs of seven registers
and memory are connected to the common bus.
• 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
since this is the binary value of decimal 3.
• 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.
• 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.
• Four registers, DR, AC, IR, and TR, have 16 bits each. Two registers, AR
and PC, have 12 bits each since they hold a memory address. When the
contents of AR or PC are applied to the 16-bit common bus, the four most
significant bits are set to 0's.
• When AR or PC receive information from the bus, only the 12 least
significant bits are transferred into the register. The input register INPR and
the output register OUTR have 8 bits each and communicate with the eight
least significant bits in the bus.
• INPR is connected to provide information to the bus but OUTR can only
receive information from the bus.
• This is because INPR receives a character from an input device which is
then transferred to AC. OUTR receives a character from AC and delivers it
to an output device. There is no transfer from OUTR to any of the other
registers.
• The 16 lines of the common bus receive information from six registers and
the memory unit. The bus lines are connected to the inputs of six registers
and the memory. 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. The increment operation is achieved by enabling the
count input of the counter. Two registers have only a LD input.
• The input data and output data of the memory are connected to the common
bus, but the memory address is connected to AR. Therefore, AR must
always be used to specify a memory address.
• By using a single register for the address, we eliminate the need for an
address bus that would have been needed otherwise. The content of any
register can be specified for the memory data input during a write operation.
Similarly, any register can receive the data from memory after a read
operation except AC .
• 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 .
They are used to implement register microoperations such as complement
AC and shift AC .
• Another set of 16-bit inputs come from the data register DR. The inputs from
DR and AC are used for arithmetic and logic rnlcrooperations, such as add
DR to AC or AND DR to AC.
• 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.
• Note that the content of any register can be applied onto the bus and an
operation can be performed in the adder and logic circuit during the same
clock cycle. The clock transition at the end of the cycle transfers the content
of the bus into the designated destination register and the output of the
adder and logic circuit into AC.
• For example, the two microoperations
DR ← AC and AC ← DR
can be executed at the same time. This can be done by placing the content
of AC on the bus (with S2S1S0 = 100), enabling the LD (load) input of DR,
transferring the content of DR through the adder and logic circuit into AC,
and enabling the LD (load) input of AC, all during the same clock cycle.
• The two transfers occur upon the arrival of the clock pulse transition at the
end of the clock cycle.
Computer Instructions
• Input-Output instruction
Memory - reference instruction
Note: The Operation code (Opcode) of an instruction refers to a group of bits that
define arithmetic and logic operations such as add, subtract, multiply, shift, and
compliment.
Input-Output instruction
Note: The three operation code bits in positions 12 through 14 should be equal to
111. Otherwise, the instruction is a memory-reference type, and the bit in position
15 is taken as the addressing mode I.
When the three operation code bits are equal to 111, control unit inspects the bit
in position 15. If the bit is 0, the instruction is a register-reference type. Otherwise,
the instruction is an input-output type having bit 1 at position 15.
Timing and Control
➢ Hardwired Control
➢ Microprogrammed Control
1) the 1 bit,
2) the operation code, and
3) bits 0 through 11.
The operation code in bits 12 through 14 are decoded with a 3 x 8 decoder. The
eight outputs of the decoder are designated by the symbols D0 through D7.
D3T4: SC <__ 0
• Initially, the CLR input of SC is active. The first positive transition of the clock
clears SC to 0, which in tum activates the timing signal T 0 out of the decoder.
• If SC is not cleared, the timing signals will continue with T5, T6 up to T15 and
back to T 0
• The last three waveforms in Fig show how SC is cleared when D 3T4 = 1.
Output D3 from the operation decoder becomes active at the end of timing
signal T2.
• When timing signal T 4 becomes active, the output of the AND gate that
implements the control function D 3T4 becomes active.
• This signal is applied to the CLR input of SC. On the next positive clock
transition (the one marked T4 in the diagram) the counter is cleared to 0.
• This causes the timing signal T 0 to become active instead of T 5 that would
have been active if SC were incremented instead of cleared.
T0: AR <__ PC
This same positive clock transition increments the sequence counter SC from 0000
to 0001 . The next clock cycle has T 1 active and T0 inactive.
Instruction cycle
If D7=0, the opcode must be one of the other seven values 000 through 110,
specifying a memory reference instruction.
• Input-Output instruction