0% found this document useful (0 votes)
35 views90 pages

Unit 1

Uploaded by

pkmngo9983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views90 pages

Unit 1

Uploaded by

pkmngo9983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 90

SARDAR PATEL COLLEGE OF ENGINEERING , BAKROL

Managed By: Tirupati Foundation Trust

INTRODUCTION TO SUBJECT
SUBJECT NAME: COMPUTER ORGANIZATION & ARCHITECTURE
SUBJECT CODE: 3140707
CREDIT : 4  { 10 – UNIT , 8 PRACTICALS }

SYLLABUS LINK: https://s3-ap-southeast-1.amazonaws.com/gtusitecirculars/Syallbus/3140707.pdf

Computer Organization & Architecture :


“Computer Organization and Architecture is the study of internal working, structuring, and
implementation of a computer system.”
SARDAR PATEL COLLEGE OF ENGINEERING , BAKROL
Managed By: Tirupati Foundation Trust

Computer Organization & Architecture

UNIT 1:
COMPUTER DATA REPRESENTATION

Prepared by: Pooa Rathod


Asst. Prof, I.T dept. (SPEC)
WHAT IS C.O.A???
• Computer Architecture:

 Deals with functional behavior of computer system.


Design implementation for the various part of computer.

• Computer Organization:

Deals with structural relation .


Operator attributes are linked together and realize the architectural
specification.

Prepared by: Pooja Rathod


WHAT IS C.O.A???
• Computer Architecture refers to those attributes of a system that have a
direct impact on the logical execution of a program.
Examples:
• The Instruction Set
• The Number of Bits Used to Represent Various Data Types
• I/O Mechanisms
• Memory Addressing Techniques
• Computer architecture is a specification detailing how a set of software and
hardware technology standards interact to form a computer system or
platform.

Prepared by: Pooja Rathod


WHAT IS C.O.A???
• Organization of a computer system defines the way system is structured so that
all those catalogued tools can be used. The significant components of
Computer organization are ALU, CPU, memory and memory organization.
• Computer Organization is how operational attributes are linked together and
contribute to realizing the architectural specification. Computer Organization
deals with a structural relationship.

Prepared by: Pooja Rathod


WHAT IS C.O.A???
• Computer Organization:
ꟷDesign of the components and functional blocks using which computer
systems are built.
ꟷAnalogy: civil engineer’s task during building construction (cement, bricks,
iron rods, and other building materials).
• Computer Architecture:
ꟷHow to integrate the components to build a computer system to achieve a
desired level of performance.
ꟷAnalogy: architect’s task during the planning of a building (overall layout,
floorplan, etc.).

Prepared by: Pooja Rathod


WHAT IS C.O.A???

Architecture describes what the computer does

Organization describes how it does it

Prepared by: Pooja Rathod


WHAT IS C.O.A???
• Machine  made for some specific Goal

• For example: “Adder” is made for addition of number (circuit of addition)

Prepared by: Pooja Rathod


Basic of computer Architecture:

COMPUTER
ARCHITECTURE

INSTRUCTION-SET HARDWARE SYSTEM


ARCHITECTURE (ISA) ARCHITECTURE (HSA)

Prepared by: Pooja Rathod


Basic of computer Architecture:
• For example:
•  X = 2+3
 Instruction :
MOV R1 02H ISA
MOV R2 03H
ADD R1 R2
STORE X R1

R1
STORAGE
ADDRER HSA
R2

Prepared by: Pooja Rathod


Block Diagram of a Computer System

Prepared by: Pooja Rathod


Block Diagram of a Computer System:
• Simplified Block Diagram of a Computer
System
• All instructions and data are stored in
memory.
• An instruction and the required data are
brought into the processor for
execution.
• Input and Output devices interface with
the outside world.
• Referred to as von-Neumann
architecture.
Prepared by: Pooja Rathod
Inside the Processor
• Also called Central Processing Unit (CPU).
• Consists of a Control Unit and an Arithmetic Logic Unit (ALU).
ꟷAll calculations happen inside the ALU.
ꟷThe Control Unit generates sequence of control signals to carry out all operations.
• The processor fetches an instruction from memory for execution.
ꟷAn instruction specifies the exact operation to be carried out.
ꟷIt also specifies the data that are to be operated on.
ꟷA program refers to a set of instructions that are required to carry out some specific task
(e.g. sorting a set of numbers).

Prepared by: Pooja Rathod


What is the role of ALU?
• It contains several registers, some general-purpose and some special purpose,
for temporary storage of data.
• It contains circuitry to carry out logic operations, like AND, OR, NOT, shift,
compare, etc.
• It contains circuitry to carry out arithmetic operations like addition,
subtraction, multiplication, division, etc.
• During instruction execution, the data (operands) are brought in and stored in
some registers, the desired operation carried out, and the result stored back in
some register or memory.

Prepared by: Pooja Rathod


What is the role of control unit?
• Acts as the nerve center that senses the states of various functional units and
sends control signals to control their states.
• To carry out a specific operation (say, R1  R2 + R3), the control unit must
generate control signals in a specific sequence.
ꟷEnable the outputs of registers R2 and R3.
ꟷSelect the addition operation.
ꟷStore the output of the adder circuit into register R1.
• When an instruction is fetched from memory, the operation (called opcode) is
decoded by the control unit, and the control signals issued.

Prepared by: Pooja Rathod


Inside the Memory Unit
• Two main types of memory subsystems.
ꟷPrimary or Main memory, which stores the active instructions and data for
the program being executed on the processor.
ꟷSecondary memory, which is used as a backup and stores all active and
inactive programs and data, typically as files.
• The processor only has direct access to the primary memory.
• In reality, the memory system is implemented as a hierarchy of several levels.
ꟷL1 cache, L2 cache, L3 cache, primary memory, secondary memory.
ꟷObjective is to provide faster memory access at affordable cost.

Prepared by: Pooja Rathod


Various different types of memory are possible
a) Random Access Memory (RAM), which is used for the cache and primary
memory sub-systems. Read and Write access times are independent of the
location being accessed.
b) Read Only Memory (ROM), which is used as part of the primary memory to
store some fixed data that cannot be changed.
c) Magnetic Disk, which uses direction of magnetization of tiny magnetic
particles on a metallic surface to store data. Access times vary depending on
the location being accessed, and is used as secondary memory.
d) Flash Memory, which is replacing magnetic disks as secondary memory
devices. They are faster, but smaller in size as compared to disk.

Prepared by: Pooja Rathod


UNIT 1 TOPICS
Basic computer data types
 Complements
 Fixed point representation
 Register Transfer and Micro-operations:
 Floating point representation
 Register Transfer language
 Register Transfer
 Bus and Memory Transfers
 Arithmetic Micro Operations
 Logic Micro-Operations
 Shift Micro-Operations
 Arithmetic logical shift unit

Prepared by: Pooja Rathod


Basic computer Data Types
• The data types found in the registers of digital computers may be classified as
beige one of the following categories:
1. Numbers Used In Arithmetic Computations
2. Letters Of The Alphabet Used In Data Processing
3. Other Discrete Symbols Used For Specific Purposes
• All types of data, except binary numbers, are represented in computer registers
in binary are represented in computer registers in binary

Prepared by: Pooja Rathod


Basic computer Data Types
• Computer programs or application may use different types of data based on the
problem or requirement.

• Given below is different types of data that computer uses:


• Numeric data – Integer and Real numbers
• Non-numeric data – Character data, address data, logical data

Prepared by: Pooja Rathod


Basic computer Data Types
• Numeric data
• It can be of the following two types:
1. Integers
2. Real Numbers
• Real numbers can be represented as:
1. Fixed point representation
2. Floating point representation

Prepared by: Pooja Rathod


Character data
• A sequence of character is called character data.
• A character may be alphabetic (A-Z or a-z), numeric (0-9), special character (+, #, *, @,
etc.) or combination of all of these. A character is represented by group of bits.
• When set of multiple character are combined together they form a meaningful data. A
character is represented in standard ASCII format

• Example of character data :


spec1#
229/3, xyZ
Hello spec – X/10

Prepared by: Pooja Rathod


Logical data
A logical data is used by computer systems to take logical decisions.
Logical data is different from numeric or alphanumeric data in the way that numeric and
alphanumeric data may be associated with numbers or characters but logical data is
denoted by either of two values true (T) or false(F).
You can see the example of logical data in construction of truth table in logic gates.
A logical data can also be statement consisting of numeric or character data with relational
symbols (>, <, =, etc.).

Character set
Character sets can of following types in computers:
Alphabetic characters- It consists of alphabet characters A-Z or a-z.
Numeric characters- It consists of digits from 0 to 9.
Special characters- Special symbols are +, *, /, -, ., <, >, =, @, %, #, etc.

Prepared by: Pooja Rathod


Note* ASCII Code
• AMERICAN STANDARD CODE FOR
INFORMATION INTERCHANGE
• ASCII code can be used for
numerals like phone numbers
and social security numbers.
• ASCII text contains plain and
unformatted text.

Prepared by: Pooja Rathod


Integer
Representation

Unsigned integer Signed integer

Signed Magnitude 1’s complement 2’s complement

Prepared by: Pooja Rathod


Integer Representation
• Unsigned integer: Unsigned integers can represent zero and positive integers,
but not negative integers. The value of an unsigned integer is interpreted as
"the magnitude of its underlying binary pattern".

n Minimum Maximum
8 0 (28)-1 (=255)
16 0 (216)-1 (=65,535)
32 0 (232)-1 (=4,294,967,295) (9+ digits)
64 0 (264)-1 (=18,446,744,073,709,551,615) (19+ digits)

Prepared by: Pooja Rathod


Integer Representation
• Signed integer: Signed integers can represent zero, positive integers, as well as
negative integers. Three representation schemes are available for signed
integers:
1. Sign-Magnitude representation
2. 1's Complement representation
3. 2's Complement representation

Prepared by: Pooja Rathod


Integer Representation (cont..)
sign-magnitude representation:
• In the sign-magnitude representation The most-significant bit (msb) is the sign bit,
with value of 0 representing positive integer and 1 representing negative integer.
• The remaining n-1 bits represents the magnitude (absolute value) of the integer.
• The absolute value of the integer is interpreted as "the magnitude of the (n-1)-bit
binary pattern".
ex :
37 = 00000000 00100101
-37 = 10000000 00100101

6712 = 00011010 00111000


-6712 = 10011010 00111000
Prepared by: Pooja Rathod
1’s Complement Representation
• In 1’s complement representation, the representation of the positive number is
same as the negative number. But the representation of the negative number is
different.

Prepared by: Pooja Rathod


2’s Complement Representation
• In 2’s complement representation also, the representation of the positive
number is same as1’s complement and sign-magnitude form.

Prepared by: Pooja Rathod


Fixed point representation
• In computing, fixed-point number representation is a real data type for a number. With
the help of fixed number representation, data is converted into binary form, and then
data is processed, stored and used by the system.

• Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a
sign bit 0, while a negative number has a sign bit 1.
• Integral Part – The integral part is of different lengths at different places. It depends
on the register’s size, like in an 8-bit register, integral part is 4 bits.
• Fractional part – Fractional part is also of different lengths at different places. It
depends on the register’s size, like in an 8-bit register, integral part is of 3 bits.
8 bits = 1Sign bit + 4 bits(integral) + 3bits (fractional part)
16 bits = 1Sign bit + 9 bits(integral) +6 bits (fractional part)
32 bits = 1Sign bit + 15 bits(integral) + 9 bits (fractional part)
Prepared by: Pooja Rathod
Floating-point representation
• To discard the limitation of fixed-point notation, floating-point number representation was
developed by scientists. The computer system uses floating-point numbers representation to
convert input data into binary form. The binary form number is converted into ‘scientific
notation,’ and then this scientific notation is converted into floating-point representation.
• The floating-point notation has two types of notation
1. Scientific notation
2. Normalized notation

Prepared by: Pooja Rathod


Floating-point representation

• Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a sign bit
0, while a negative number has a sign bit 1. In floating-point representation, sign of a
number always depends on mantissa, not on exponent. Hence sign bit in the format is
always for mantissa and not for the exponent.
• Mantissa Part –Mantissa part is of different length at a different place. It depends on the
size of the register like in 16-bit register; mantissa part is of 8 bits.
• Exponent part – Exponent is the power of the number. It depends on the register’s size;
like in the 16-bit register, exponent part is 7 bits. Excess 16,64,128, 512 are used to store
exponent in this format.

Prepared by: Pooja Rathod


Floating-point representation
1. Scientific notation – Method of representing binary numbers into a x be form.
For example:-
Number = 376.423 ( its not scientific notation)
Number in scientific = 36.4423 x 101 or 3.64423 x 102

For example:- 32.625 x 103

1101.101 * 2101

Prepared by: Pooja Rathod


Floating-point representation
• Normalized notation– It is a special case of scientific notation. Normalized
means after the decimal point, we have at least one non-zero digit.
• Normalized notation –

Prepared by: Pooja Rathod


Register Transfer and Micro-operations:

Fig: Shift and Store Bus Register

Prepared by: Pooja Rathod


Register Transfer and Micro-operations:
Register :
• A Register is a fast memory used to accept, store, and transfer data and
instructions that are being used immediately by the CPU.
• A Register can also be considered as a group of flip-flops with each flip-flop
capable of storing one bit of information.
• A register with n flip-flops is capable of storing binary information of n-bits.

Prepared by: Pooja Rathod


Following are some commonly used registers:
• Accumulator: This is the most common register, used to store data taken out
from the memory.
• General Purpose Registers: This is used to store data intermediate results
during program execution. It can be accessed via assembly programming.
• Special Purpose Registers: Users do not access these registers. These registers
are for Computer system,
• MAR: Memory Address Register are those registers that holds the address
for memory unit.
• MBR: Memory Buffer Register stores instruction and data received from the
memory and sent from the memory.
• PC: Program Counter points to the next instruction to be executed.
• IR: Instruction Register holds the instruction to be executed.

Prepared by: Pooja Rathod


Register
• Computer Registers are designated by capital letters.
• An 8-bit register means, it can store 8 bit of data, 32-bit register means it can
store 32 bit of data.
• For example,
• PC – Program Counter
• IR – Instruction Register
• R1 – Processor Register

7 6 5 4 3 2 1 0
Register R Showing individual bits
15 0 15 8 7 0
PC (H) PC (L)
Numbering of bits Divided into two parts

Prepared by: Pooja Rathod


Register Number
Function
Symbol of Bits
OUTR 8 holds output character.

INPR 8 It holds input character.

PC 12 It holds the address of the instruction.

AR 12 It holds an address for memory.

DR 16 It holds memory operand.

AC 16 It’s a processor register.

IR 16 It holds an instruction code.

TR 16 It holds temporary data.

Prepared by: Pooja Rathod


The description for each of the registers determined in the figure is as follows −

• The data register holds the operand read from the memory.
• The accumulator is a general-purpose register need for processing.
• The instruction register holds the read memory.
• The temporary data used while processing is stored in the temporary register.
• The address register holds the address of the instruction that is to be implemented next
from the memory.
• The Program Counter (PC) controls the sequence of instructions to be read. In case a
branch instruction is detected, the sequential execution does not arise. A branch execution
calls for a transfer to an instruction that is not in sequence with the instructions in the PC.
• The input register (INPR) and output register (OUTPR) are the registers used for the I/O
operations. The INPR receives an 8-bit character from the input device. It is similar to the
OUTPR.
Prepared by: Pooja Rathod
Register Transfer :
 The information transformed from one register to another register is
represented in symbolic form by replacement operator is called Register
Transfer.
 The symbolic notation used to describe the micro-operation transfers amongst
registers is called Register transfer language.
 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.
 For example:
• 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
Prepared by: Pooja Rathod
Micro-Operation
• “The operations executed on data stored in registers are called micro-
operations. A micro-operation is an elementary operation performed on the
information stored in one or more registers.”
• Example: Shift, count, clear and load.
• micro-operations (also known as micro-ops) are the functional or atomic,
operations of a processor.
• These are low level instructions used in some designs to implement complex
machine instructions.

Prepared by: Pooja Rathod


Micro-Operation

Prepared by: Pooja Rathod


Types of Micro-Operations
The micro-operations in digital computers are of 4 types:
1. Register transfer micro-operations transfer binary information from one
register to another.
2. Arithmetic micro-operations perform arithmetic operations on numeric
data stored in registers.
3. Logic micro-operations perform bit manipulation operation on non-
numeric data stored in registers.
4. Shift micro-operations perform shift micro-operations performed on data.

Prepared by: Pooja Rathod


Register Transfer Language
• The symbolic notation used to describe the micro-operation transfers amongst
registers is called Register transfer language.
• A register transfer language is a system for expressing in symbolic form the
micro operation sequences among the register of a digital module.
• The term “Register Transfer" implies the availability of hardware logic circuits
that can perform a stated microoperation and transfer the result of the
operation to the same or another register.
• The word “Language" is borrowed from programmers, who apply this term to
programming languages.
• A register transfer language is a system for expressing in symbolic form the
microoperation sequences among the registers of a digital module.

Prepared by: Pooja Rathod


Register Transfer Language
• For example,
• R1 ← R2
• This statement denotes a transfer of the content of register R2 into register R1.
• Here, content of R1 is replaced by content of R2.
• Content of R2 is not affected by this transfer.
• For example,
• T=1: R2 ← R1, R1 ← R2
• Registers (R1, R2) are denoted by capital letters, and numerals.
• Parentheses ( ) are used to denote a part of a register.
• The arrow (←) denotes a transfer of information and the direction of transfer.
• A comma ( , ) is used to separate two or more operations that are executed at the same
time

Prepared by: Pooja Rathod


Register Transfer :control function
• If we want the transfer to occur only under a predetermined control condition, Then This can
be shown by means of an if-then statement.
If (P = 1) then (R2 R1)
where P is a control signal generated in the control section.
• It is sometimes convenient to separate the control variables from the register
transfer operation by specifying a control function.
• A control function is a Boolean variable that is equal to 1 or 0.
• The control function is included in the statement as follows:
P: R2  R1
• The control condition is terminated with a colon. It symbolizes the requirement
that the transfer operation be executed by the hardware only if P = 1.

Prepared by: Pooja Rathod


Register Transfer :control function
• Figure shows the block diagram of the transfer from R1 to R2.
• The n outputs of register R1 are connected to the n inputs of register R2.
• The letter n will be used to indicate any number of bits for the register.
• It will be replaced by an actual number when the length of the register is known.
• Register R2 has a load input that is activated by the control variable P.
• It is assumed that the control variable is synchronized with the same clock as the one
applied to the register. As show

Prepared by: Pooja Rathod


Bus and Memory Transfers
• Bus : “In computer architecture, a bus (related to the Latin “omnibus”, meaning “for all”) is
a communication system that transfers data between components inside a computer, or
between computers.”
• A typical digital computer has many registers, and paths must be provided to transfer
information from one register to another.
• The number of wires will be excessive if separate lines are used between each register and
all other registers in the system.
• A more efficient scheme for transferring information between registers in a multiple-
register configuration is a common bus system.
• A bus structure consists of a set of common lines, one for each bit of a register, through
which binary information is transferred one at a time.

Prepared by: Pooja Rathod


Bus Transfer :
• A bus transfer is the most effective method to send data by using a common
bus system.
• It is constructed using common bus registers in multiple registers.
• The mechanism of the bus includes a collection of lines. These lines are
registers of one bit each, which share only one information at a time.
• The data transfer is contained by the control signals.
• The two methods that can be used in Bus transfer are as follows −
1. Using multiplexer
2. Using three states bus buffers

Prepared by: Pooja Rathod


Common Bus System for 4 registers (Using multiplexer)
4-line
0
S1 common
0 bus
S0 A1
A3 A2 A0

4x1 4x1 4x1 4x1


MUX 3 MUX 2 MUX 1 MUX 0
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0

D2 C2 B2 A2 D1 C1 B1 A1 D0 C0 B0 A0

D2 D1 D0 C2 C1 C0 B2 B1 B0 A2 A1 A0

3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
Register D Register C Register B Register A

Prepared by: Pooja Rathod


Prepared by: Pooja Rathod
Common Bus System for 4 registers (Using multiplexer)
• The construction of a bus system for four registers is explained earlier.
• Each register has four bits, numbered 0 through 3.
• The bus consists of four 4 x 1 multiplexers each having four data inputs, 0 through 3, and two
selection inputs, S1 and S0.
• The diagram shows that the bits in the same significant position in each register are
connected to the data inputs of one multiplexer to form one line of the bus.
• The two selection lines S1 and S0 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
common bus.
• When S1 S0 = 00, the 0 data inputs of all four multiplexers are selected and applied to the
outputs that form the bus.
• This causes the bus lines to receive the content of register A since the outputs of this register
are connected to the 0 data inputs of the multiplexers.
Prepared by: Pooja Rathod
Common Bus System for 4 registers (Using multiplexer)
• Table shows the register that is selected by the bus
for each of the four possible binary values of the
selection lines.
S1 S0 Register
• In general, a bus system will multiplex k registers of Selected
n bits each to produce an n-line common bus. 0 0 A
• The number of multiplexers needed to construct the 0 1 B
bus is equal to n, the number of bits in each register. 1 0 C
• The size of each multiplexer must be k x 1 since it 1 1 D
multiplexes k data lines.
• For example, a common bus for eight registers of 16
bits requires
Multiplexers - 16 of (8 x 1)
Select Lines - 3
Prepared by: Pooja Rathod
Common Bus System for 4 registers (Using multiplexer)
• The transfer of information from a bus into one of many destination registers can be
accomplished by connecting the bus lines to the inputs of all destination registers and
activating the load control of the particular destination register selected.
• When the bus is includes in the statement, the register transfer is symbolized as follows:
BUS  C, R1  BUS
• The content of register C is placed on the bus, and the content of the bus is loaded into
register R1 by activating its load control input.
• If the bus is known to exist in the system, it may be convenient just to show the direct
transfer.
R1  C
• From this statement the designer knows which control signals must be activated to produce
the transfer through the bus.

Prepared by: Pooja Rathod


Tri-state Buffer (3 state Buffer)
• A three-state gate is a digital circuit that exhibits three states.
• Two of the states are signals equivalent to logic 1 and 0 as in a conventional gate.
• The third state is high impedance state which behaves like an open circuit, which means that
the output is disconnected and does not have logic significance.
• The control input determines the output state. When the control input C is equal to 1, the
output is enabled and the gate behaves like any conventional buffer, with the output equal
to the normal input.
• When the control input C is 0, the output is disabled and the gate goes to a high-impedance
state, regardless of the value in the normal input.

Output Y = A if C =1
Normal Input A
High-impedance if C = 0

Control Input C

Prepared by: Pooja Rathod


Using three states bus buffers:
• Three-state buffers can generate a common bus. The buffer is an area of the
memory, which is added in between the other devices to block several
interactions and to connect the support.
• It is established on the three states, 1, 0, and the open circuit.
• These three states defines are as follows −
• The logic 0 and 1 are the two signals similar to the ones in the conventional gate.
• The high impedance state defines that it does not contain the logic significance and the
output is separated.
• These three-state gates can implement any conventional logic AND or NAND, OR, or
NOR.

Prepared by: Pooja Rathod


Common Bus System using Decoder and Tri-state Buffer

Bus line for bit 0


A0

B0

C0

D0

0
1
S1
Select 1
0 2x4
S0 Decoder 1
2
Enable
E
3

Prepared by: Pooja Rathod


Common Bus System using Decoder and Tri-state Buffer
• The construction of a bus system with three-state buffers is demonstrated in previous figure.
• The outputs of four buffers are connected together to form a single bus line.
• The control inputs to the buffers determine which of the four normal inputs will
communicate with the bus line.
• The connected buffers must be controlled so that only one three-state buffer has access to
the bus line while all other buffers are maintained in a high impedance state.
• One way to ensure that no more than one control input is active at any given time is to use a
decoder, as shown in the figure: Bus line with three state-buffers.
• When the enable input of the decoder is 0, all of its four outputs are 0, and the bus line is in
a high-impedance state because all four buffers are disabled.
• When the enable input is active, one of the three-state buffers will be active, depending on
the binary value in the select inputs of the decoder.

Prepared by: Pooja Rathod


Memory Transfer:
• The transfer of information from a memory unit to the user end is called a Read operation.
• The transfer of new information to be stored in the memory is called a Write operation.
• A memory word is designated by the letter M.
• We must specify the address of memory word while writing the memory transfer
operations.
• The address register is designated by AR and the data register by DR.
• Thus, a read operation can be stated as:
Read: DR ← M [AR]
• The Read statement causes a transfer of information into the data register (DR) from the
memory word (M) selected by the address register (AR). And the corresponding write
operation can be stated as:
Write: M [AR] ← R1
• The Write statement causes a transfer of information from register R1 into the memory
word (M) selected by address register (AR).
Prepared by: Pooja Rathod
Memory Transfer:

Prepared by: Pooja Rathod


Types of Micro-operations
Register Transfer Micro- Transfer binary information from one register
operations: to another.
Arithmetic Micro-operations: Perform arithmetic operation on numeric data
stored in registers.
Logical Micro-operations: Perform bit manipulation operations on data
stored in registers.
Shift Micro-operations: Perform shift operations on data stored in
registers.

Prepared by: Pooja Rathod


s
s

Prepared by: Pooja Rathod


Arithmetic Microoperations
• Arithmetic microoperations perform arithmetic operations on numeric data
stored in registers.
Symbolic Description
Designation
Contents of plus transferred to
Contents of minus transferred to
Complement the contents of (1’s complement)
2’s complement the contents of
plus the 2’s complement of (subtraction)
Increment the content of by one
Decrement the content of by one

Prepared by: Pooja Rathod


4-bit Binary Adder
• The digital circuit that generates the arithmetic sum of two binary numbers of
any length is called a binary adder.
• Example
0 1 1 1 1 0 1 1
B3 A3 B2 A2 B1 A1 B0 A0
C 1 1 1 0
1 1 1 0
R1 1 1 0 1 A C3 C2 C1 C0
FA FA FA FA
R2 + 0 1 1 1 B
Sum 1 0 1 0 0
C4 S3 S2 S1 S0
1 0 1 0 0

Prepared by: Pooja Rathod


4-bit Binary Adder:
• 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.
• 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).
Prepared by: Pooja Rathod
4-bit Binary Adder-Subtractor
when M = 0 the circuit is an Adder When M = 0, we have When M = 1, we have
when M = 1 the circuit becomes a Subtractor C0 = 0 & B ⊕ 0 = B C0 = 1 & B ⊕ 1 = B’

B3 A3 B2 A2 B1 A1 B0 A0
1 0
1 0 1 0 1 0 1 0 M

B 3’ B 3 B 2’ B 2 B 1’ B 1 B 0’ B 0
C3 C2 C1 C0
FA FA FA FA

C4 S3 S2 S1 S0

Prepared by: Pooja Rathod


4-bit Binary Adder-Subtractor
• The operations of both addition and subtraction can be performed by a one common
binary adder. Such binary circuit can be designed by adding an Ex-OR gate with each
full adder as shown in below figure.
• 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.
• 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.
• 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

Prepared by: Pooja Rathod


4-bit Binary Incrementor :
• The increment microoperation adds one to a number in a register.
1 1 0 1
A3 A2 A1 A0 1
0 0 1

x y x y x y x y
C 0 0 1
R1 1 1 0 1 HA HA HA HA
+ 1
Sum 1 1 1 0 C S C S C S C S

C4 S3 S2 S1 S0
0 1 1 1 0

Prepared by: Pooja Rathod


4-bit 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 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.
• 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.
• The output carry C4 will be 1 only after incrementing binary 1111.
Prepared by: Pooja Rathod
4-bit Arithmetic Circuit

Prepared by: Pooja Rathod


4-bit Arithmetic Circuit
D0 D1 D2 D3 Cout
0
C0 C1 C1 C2 C2 C3 C3 C4
FA FA FA FA
X0 Y0 X1 Y1 X2 Y2 X3 Y3
1 1 1 1
4x1 4x1 4x1 4x1
MUX MUX MUX MUX
S1 S 0 0 1 2 3 S1 S 0 0 1 2 3 S1 S 0 0 1 2 3 S1 S 0 0 1 2 3

0 0
Cin A0 B0 A1 B1 A2 B2 A3 B3
1 S1 S0 1
Prepared by: Pooja Rathod
4-bit Arithmetic Circuit
• 4 full-adder circuits that constitute the 4-bit adder and four multiplexers for choosing
different operations.
• There are two 4-bit inputs A and B.
• The four inputs from A go directly to the X inputs of the binary adder. Each of the four
inputs from B is connected to the data inputs of the multiplexers. The multiplexer’s data
inputs also receive the complement of B.
• The other two data inputs are connected to logic-0 and logic-1.
• Logic-0 is a fixed voltage value (0 volts for TTL integrated circuits)
• Logic-1 signal can be generated through an inverter whose input is 0.
• The four multiplexers are controlled by two selection inputs, S1 and S0.
• The input carry Cin goes to the carry input of the FA in the least significant position. The
other carries are connected from one stage to the next.
• 4-bit output D0…D3
Prepared by: Pooja Rathod
4-bit Arithmetic Circuit
• When S1S0 = 00
• If Cin = 0 then D = A + B; Add
• If Cin = 1 then D = A + B + 1; Add with carry
• When S1S0 = 01
• If Cin = 0 then D = A + ; Subtract with borrow
• If Cin = 1 then D = A + + 1; A + 2’s complement of B i.e. A - B
• When S1S0 = 10
• Input B is neglected and all 0’s are inserted to Y inputs
D = A + 0 + Cin
• If Cin = 0 then D = A; Transfer A
• If Cin = 1 then D = A + 1; Increment A
• When S1S0 = 11
• Input B is neglected and all 1’s are inserted to Y inputs
D = A - 1 + Cin
• If Cin = 0 then D = A - 1; 2’s compliment
• If Cin = 1 then D = A; Transfer A
Prepared by: Pooja Rathod
 Logic Microoperations
• Logic microoperations specify binary operations for strings of bits stored in
registers.
• These operations consider each bit of the register separately and treat them
as binary variables.
• Logic micro-operations are working of few logic gates.
• Logic gates are used to implement the Boolean function, and gates are the
circuits that can allow or cannot allow current to pass through them.
• If current passes, it gives value 1, otherwise it gives value 0.

Prepared by: Pooja Rathod


Logic Microoperations
Boolean Microoperation Name Boolean Microoperation Name
Function Function
Clear NOR
AND Exclusive-NOR
Complement B
Transfer A

Complement A
Transfer B
Exclusive-OR
NAND
OR
Set to all 1’s

Prepared by: Pooja Rathod


Implementation of Logic Circuit

S1
S0 S1 S0 Output Operation
Ai 0 0 AND
0
Bi
0 1 OR
4x1
1 Ei
MUX 1 0 XOR

2
1 1 Complement

Prepared by: Pooja Rathod


 Shift Microoperations
Types of Shift

Logical Circular Arithmetic

Prepared by: Pooja Rathod


Shift Microoperations
• Shift microoperations are used for serial transfer of data.
• Used in conjunction with arithmetic, logic and other data processing
operations.
• The content of the register can be shifted to the left or the right.
• The first flip-flop receives its binary information from the serial input.
• The information transferred through the serial input determines the type of
shift.

Prepared by: Pooja Rathod


Types of Shift
1. Logical Shift
• A logical shift is one that transfers 0 through the serial input.

SHL - logical shift left SHR - logical shift right

R1 1 1 0 1 R1 1 1 0 1

R1 1 0 1 0 R1 0 1 1 0

Prepared by: Pooja Rathod


2. Circular Shift
• A circular shift (also known as a rotate operation) circulates the bits of the
register around the two ends without loss of information.
• This is accomplished by connecting the serial output of the shift register to its
serial input.
CIL - circular shift left CIR - circular shift right

R1 1 1 0 1 R1 1 1 0 1

R1 1 0 1 1 R1 1 1 1 0

Prepared by: Pooja Rathod


3. Arithmetic Shift
• An arithmetic shift is a micro-operation that shifts a signed binary number to
the left or right.
• An arithmetic shift-left multiplies a signed binary number by 2.
• An arithmetic shift-right divides the number by 2.
ASHL - arithmetic shift left ASHR - arithmetic shift right

R1 1 1 0 1 R1 1 1 0 1

R1 1 0 1 0 R1 1 1 1 0

Prepared by: Pooja Rathod


4 - bit Combinational Circuit Shifter
0 – Shift right
Select 1 – Shift left
0
S 0 H0
IR 0 MUX
1
1
A0 H0 H1 H2 H3
1 S
A1 S
1 H1
0 0 MUX 0 IR A0 A1 A2
A2 1
1 A1 A2 A3 IL
1
A3 S 1 H2
0 MUX
1

S
0 MUX
0 H3
IL 1

Prepared by: Pooja Rathod


 Arithmetic logical shift unit
• Instead of having individual registers performing the micro operations
directly, computer systems employ a number of storage registers connected
to a common operational unit called an arithmetic logic unit, abbreviated
ALU.
• To perform a microoperation, the contents of specified registers are placed in
the inputs of the common ALU.
• The ALU performs an operation and the result of the operation is then
transferred to a destination register.
• The arithmetic, logic, and shift circuits introduced in previous sections can be
combined into one ALU with common selection variables.

Prepared by: Pooja Rathod


4 - bit Arithmetic Logic Shift Unit
S3
S2
S1 Ci
S0
One stage of Di
arithmetic
circuit
Select

0 4x1 Fi
Ci +1 1 MUX
2
3
One stage of Ei
Bi logic circuit
Ai
Ai-1 SHR
Ai+1 SHL

Prepared by: Pooja Rathod


4 - bit Arithmetic Logic Shift Unit

S3 S2 S1 S0 Cin Operation Function S3 S2 S1 S0 Cin Operation Function


0 0 0 0 0 F=A Transfer A 0 0 1 1 1 F=A Transfer A
0 0 0 0 1 F=A+1 Increment A 0 1 0 0 x F= AND
0 0 0 1 0 F=A+B Addition 0 1 0 1 x F= OR
0 0 0 1 1 F=A+B+1 Add with carry
0 1 1 0 x F = A ⊕B XOR
Subtract with 0 1 1 1 x F = A’ Complement A
0 0 1 0 0 F = A + B’ borrow
1 0 x x x F = shr A Shift right A into F
0 0 1 0 1 F = A + B’ + 1 Subtraction
1 1 x x x F = shl A Shift left A into F
0 0 1 1 0 F=A–1 Decrement

Prepared by: Pooja Rathod


Assignment Question (GTU)
1. Explain three state buffers.
2. What is the need of common bus? Draw common bus cycle
3. Construct a 4-bit adder-subtractor and design a digital circuit for 4-bit binary
adder circuit.
4. Explain 4 bit arithmetic circuit with suitable diagram.
5. Design a simple arithmetic circuit which should implement the following
operations: Assume A and B are 3 bit registers. Add : A+B, Add with Carry:
A+B+1, Subtract: A+B’, Subtract with Borrow: A+B’+1, Increment A: A+1,
Decrement A: A-1, Transfer A: A

Prepared by: Pooja Rathod


Assignment Question (GTU)
6. Short Questions
a) Define term RTL
b) What is computer organization?
c) Explain Micro operation.
d) What does this mean : R2  R1
e) What does this mean : T0: R4  R0
f) What is BUS
g) What is logical shift and Arithmetic shift

Prepared by: Pooja Rathod


Prepared by: Pooja Rathod

You might also like