UNIT - 1 Digital
UNIT - 1 Digital
Digital computers:
Digital computers are the cornerstone of modern technology and have revolutionized
the way we process, store, and manipulate information. These electronic devices use a
binary system, which consists of two symbols (0 and 1), to represent and work with
data.
A block diagram of a digital computer typically represents the major components and
their interactions. Please note that the specific configuration and components may
vary depending on the type and purpose of the computer, but I can provide a general
overview of the common components you would find in a typical digital computer:
1. Input Devices: These are the devices that allow users to input data into the
computer. Examples include keyboards, mice, touchscreens, and microphones.
2. Central Processing Unit (CPU): The CPU is the brain of the computer. It performs
arithmetic and logical operations, executes instructions, and controls the operation of
other components. Modern computers often have multiple cores or processors.
3. Memory (RAM): Random Access Memory (RAM) is used to temporarily store data
that the CPU is actively using. It provides fast access to data and instructions required
by the CPU.
4. Storage Devices: These devices store data and programs for the long term.
Examples include hard disk drives (HDDs), solid-state drives (SSDs), and optical
drives (CD/DVD/Blu-ray).
7. Graphics Processing Unit (GPU): The GPU is responsible for rendering graphics
and performing parallel processing tasks. It is particularly important for gaming and
graphical applications.
8. Power Supply Unit (PSU): The PSU provides electrical power to the computer's
components.
10. Expansion Slots: These slots allow for the addition of various expansion cards,
such as graphics cards, sound cards, and network cards.
11. Network Interface Card (NIC): This component allows the computer to connect to
networks, including local area networks (LANs) and the internet.
12. Optical Drives: Optical drives can read and write data to optical discs like CDs,
DVDs, and Blu-rays (though these are becoming less common with the rise of digital
distribution).
13. Ports and Connectors: These are used for connecting external devices, such as
USB ports, audio jacks, HDMI ports, and Ethernet ports.
14. Operating System (OS): The operating system is software that manages the
computer's hardware resources and provides a user interface for interaction with the
computer.
15. Application Software: These are the programs and applications that users run on
the computer to perform specific tasks, such as word processing, web browsing, or
gaming.
17. System Bus: The system bus is a set of electrical pathways used for data transfer
between the CPU, RAM, and other components.
18. Data Bus and Address Bus: These buses facilitate the transfer of data and
addresses between the CPU and memory.
19. Control Unit: This component of the CPU manages and coordinates the execution
of instructions.
20. ALU (Arithmetic Logic Unit: The ALU performs mathematical and logical
operations required by the CPU's instructions.
Introduction
• 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.
• The software of the computer consists of the instructions and data that the
computer manipulates to perform various data-processing tasks.
The main objective of this subject to understand the overall basic computer hardware
structure, including the peripheral devices. Computer Organization refers to the
operational units and their interconnections that realize the architectural
specifications. Examples are things that are transparent to the programmer: Like
control signals
It is those attributes visible to the programmer. They are like. Instruction set, number
of bits used for data representation, I/O mechanisms, addressing techniques.
• It includes the information, formats, the instruction set, and techniques for
addressing memory.
• The architectural design of a computer system is concerned with the
specifications of the various functional modules, such as processors and
memories, and structuring them together into a computer system.
2.Harvard architecture
Computer Organization
• Computer Organization tells us how exactly all the units in the system
are arranged and interconnected. Whereas Organization expresses the
realization of architecture.
Microoperation
Registers are temporary storage devices. Operations are performed on the
information stored in these register.
(a) The registers available in a digital system and function of each register.
The microoperations applied to the hardware logic circuits such as gates that
perform information transfer among registers. This is known as "Register
Transfer".
1. BRO X
2. BRN X
3. BRZ X
4. BRP X
5. BRER, R., X
Basic Definitions
Registers:
Computer registers are designated by upper case letters (and optionally
followed by digits or letters) to denote the function of the register.
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.
The most common way to represent a register is by a rectangular box with the
name of the register inside, as in shown in Fig. (a)
16-bit
bit register is partitioned into two parts in (d). Bits 0 through 7 are assigned
the symbol L (for low byte) and bits 8 through 15 are a assigned
ssigned the symbol H
(for high byte).
BUS:AA bus structure consists of a set of common lines, one for each bit of a
register,
ter, through which binary information is transferred one at a time.
Control signals determine which register is selected by the bus during each
particular register transfer.
The number of multiplexers needed to construct the bus is equal to ‘n’. Where
n is the number of bits of each register.
Three-State
State Bus Buffers
State1 logic 1
State2 logic 0
Read: DR M[AR]
Here AR is the register that contain the address of the memory location from
which the data to be transferred
M is the memory .
Write: M[AR] DR
The transfer of new information to be stored into the memory is called a write
operation.
A memory unit that receives the address from a register, called the address
register, symbolized by AR .
The data are transferred to another register, called the data register,
symbolized by DR.
The increment and decrement micro operations are symbolized by plus one
and minus-one operations, respectively. These micro operations are
implemented with a combinational circuit or with a binary up-down counter.
Half-Adder
Consider the following operations,
0+0=00
0+1=01
1+0=01
1+1=10
These operations are executed usin
usingg a logic circuit called half adder. The half
adder takes two binary digits as inputs and generates two binary digits as
outputs (ie sum and carry). The following table shows the truth table for the
half adder,
From the operation of the half-adder as stated in the above table, expressions
can be derived for the sum and the output carry as functions of the inputs. It
can be observed that, the output carry (Cout) is 1 only when both A and B are 1.
Therefore, can be expressed as the AND of the input variables.
Cout=AB
Now, observe that the sum output is I only if the input variables A and B are
different. The sum can therefore be expressed as the exclusive-OR of the input
variables,
Half Adder
Full-Adder
The full adder is the second category of the address. It operates by taking two inputs
A, B and input carry and produces an output of sum and output carry. A logic symbol
for a full-adder is shown in the figure.
Logical symbol for Full adder
Full adder
Parallel Adder
A single full adder is an adder which is effective of adding two one-bit
number and an input carry. The addition of binary number with multiple bits
can only be performed with the use of full adders. This is called a parallel
adder. When one binary number is added to another, each column generates a
sum bit and a carry bit (0 or 1) to the next column to the left, as illustrated
here with 2-bit numbers.
To get the 2's complement of a number, first find out its I's complement and
then add I to the Least Significant Bit (LSB). The following example illustrates
the subtraction of two numbers,
Logic Micro Operations
Logic Microoperations
The binary operations for bit strings present in a register are specified by the
logic microoperations. Binary contents of a register are considered as distinct
binary variables.
(i) Selective-set
set operation
(ii) Selective-complement
complement operation
(iii) Selective-clear
clear operation
(iv) Mask operation
(v) Insert operation
(vi) Clear operation.
(i) Selective-set Operation
It considers only 1's in register Y and sets the corresponding bits in
the register X to I wherever 1's are encountered in register Y.
Ignore performing operations on bits of register X whose
corresponding bits in register Y are O's.
It considers only 1's in register Y and clears the corresponding bits in the register X to
0.
(iv) Mask Operation
It considers only O's in register Y and clears the corresponding bits in register X to 0.
Let the bits 1100 be inserted in register X then these bits are ORed
with the resulting masked register X.
(vi) Clear Operation
The operations that are performed here is shift left operation and
shift right operation. In former one, the operation of serial input
transfers bit to the right most position where as in latter one, the
operation of serial input transfers bit to the left most position.
The shift operations are categorized into three types,
1. Logical shift
2. Arithmetic shift
1. Logical Shift
The above figure shows a register that holds 'n' bits. The left most bit in the
register stores Bn-1, which is the sign bit. The bits Bn-2 and B0, specify the most
significant and least significant bits of the number respectively. In the
arithmetic shift-right operation, the sign bit must remain the same and the bits
along with the sign bit must be shifted from left to right. Hence, the bit B n-1
does not change and is passed to Bn-2. The received bit in Bn-2 is again passed
to Bn-3. and so on till B0, receives a bit from B1,. As a result, the bit in B0, is
removed.
During the arithmetic shift-left operation, a zero is bit gets placed in the B 0,
position and the remaining bits in the register are shifted towards the left
Hence, the value at Bn-1 lost and a new value which is received from B n-2 bit is
stored in Bn-1... Depending upon the new value, the sign bit changes after the
left shift operation. The sign reversal is performed when an overflow occurs
after the multiplication of number by 2.
The circular shift or rotate is also called as rotate microoperation. During the
shifting of bits in shift microooperation, the bits which are shifted out of
register go off track (lost). However, this bit is maintained by circular shift. It
operates by shifting each bit out of one end of register and giving back into the
other end of the register. The two types of rotate microoperations are rotate left
(RL or CshL) and rotate right (RR or CshR).
Arithmetic Logic Shift Unit
The arithmetic, logic and shift circuits can be combined into one composite
circuit with the help of a multiplexer to get the arithmetic logic shift unit. The
following figure shows one stage of an arithmetic logic shift unit.
Both the arithmetic and logic unit receive inputs P i, and Qi, here the suffix i
represents a typical stage i. Inputs Si, and S0 are used to select a particular
microoperation, while S2, and S3, select the data in the multiplexer. The other
two inputs to the multiplexer are Pi-1 and Pi+1 that perform shift-right and
shift-left operations respectively. Actually the purpose of 4x1 multiplexer to
select between an arithmetic output in yi, and logical output in Zi, The diagram
shown above is the typical representation of stage 1. It must be repeated n
times to obtain n-bit ALU. In case of multistage ALU, the output carry C i+1, of a
given arithmetic stage is connected to input carry C i, of the next stage. The
following table gives the list of operations that can be performed using
anthmetic logic shift circuit.
As shown in the above table, there are 8 arithmetic operations which are
selected when S3S2=00. When S3S2=01 logical operations are selected. Shift
operations are selected when S3S2=10 and S3S2 =11.
The input value X' denote don't-care condition. The inputs marked with X's
have no effect during the particular operation.
Instruction codes
An instruction code is a group of bits that instruct the computer to perform a
specific operation. It is usually divided into parts, each having its own particular
interpretation. The most basic part of an instruction code is its operation part. The
operation code of an instruction is a group of bits that define such operations as
add, subtract, multiply, shift, and complement.
The number of bits required for the operation code of an instruction depends on the
total number of operations available in the computer. The operation code must
consist of at least n bits for a given 2n (or less) distinct operations. When this
operation code is decoded in the control unit, the computer issues control signals to
read an operand from memory and add the operand to a processor register.
Above Figure depicts this type of organization. Instructions are stored in one
section of memory and data in another. For a memory unit with 4096 words we
need 12 bits to specify an address since 2 12 = 4096.
If we store each instruction code in one 16-bit
bit memory word, we have available
four bits for the operation code (abbreviated opcode) to specify one out of 16
possible operations, and 12 bits to specify the address of an operand. The control
reads a 16-bit
bit instruction from the program porti
portion
on of memory. It uses the 12-bit
12
address part of the instruction to read a 16
16-bit
bit operand from the data portion of
memory. It then executes the operation specified by the operation code.
Indirect Address
It is sometimes convenient to use the address bits of an instruction code not as an
address but as the actual operand. When the second part of an instruction code
specifies an operand, the instruction is said to have an immediate operand. When
the second part specifies the address of an operand, the instruction is said to have a
direct address. This is in contrast to a third possibility called indirect address,
where the bits in the second ppart
art of the instruction designate an address of a
memory word in which the address of the operand is found. One bit of the
instruction code can be used to distinguish between a direct and an indirect
address.
COMPUTER REGISTERS
Computer instructions are normally stored in consecutive memory locations and
are executed sequentially one at a time.
The control reads an instruction from a specific address in memory and executes it.
It then continues by reading the nnext
ext instruction in sequence and executes it, and so
on. This type of instruction sequencing needs a counter to calculate the address of
the next instruction after execution of the current instruction is completed. It is also
necessary to provide a register in the control unit for storing the instruction code
after it is read from memory. The computer needs processor registers for
manipulating data and a register for holding a memory address
To read an instruction, the content of PC is taken as the address for memory and a
memory read cycle is initiated. PC is then incremented by one, so it holds the
address of the next instruction in sequence.
INPUT REGISTER(INPR)
OUTPUT REGISTER(OUTR)
Computer Instructions
Computer instructions are a set of machine language instructions that a particular
processor understands and executes. A computer performs tasks on the basis of the
instruction provided.
Timing Signals
Timing signals are generated by the sequence
counter (SC), which receives as inputs the clock
pulse, increment and clear.
The SC’s outputs are decoded into 16 timing
signal T0 through T15, which are used to control
the sequence of operations.
The RTL statement
D3T4: SC 0
T0: AR PC
Subsequently, as we fetch the instruction to be executed, we must increment
the program counter so that it points to the next instruction: