0% found this document useful (0 votes)
16 views31 pages

COMPUTER_ORGANIZATION-U-1

The document provides an overview of computer organization, detailing the basic structure, types of computers, generations, functional units, operational concepts, and performance metrics. It explains the roles of various components like the input unit, memory unit, arithmetic and logic unit, and control unit, as well as the importance of bus structures and software in computer operations. Additionally, it discusses performance evaluation through execution time and benchmarking methods.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views31 pages

COMPUTER_ORGANIZATION-U-1

The document provides an overview of computer organization, detailing the basic structure, types of computers, generations, functional units, operational concepts, and performance metrics. It explains the roles of various components like the input unit, memory unit, arithmetic and logic unit, and control unit, as well as the importance of bus structures and software in computer operations. Additionally, it discusses performance evaluation through execution time and benchmarking methods.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Computer Organization [IT II – I ]

UNIT I
Basic Structure Of Computers: Computer Types, Functional unit, Basic OPERATIONAL
concepts, Bus structures, Software, Performance, multiprocessors and multi computers.
Data Representation: Fixed Point Representation. Floating – Point Representation. Error Detection
codes.
Register Transfer Language And Micro Operations: Register Transfer language. Register
Transfer Bus and memory transfers, Arithmetic Micro operations, logic micro operations, shift micro
operations, Arithmetic logic shift unit.

Basic Structure of Computers


Computer Architecture in general covers three aspects of computer design namely: Computer
Hardware, Instruction set Architecture and Computer Organization.
Computer hardware consists of electronic circuits, displays, magnetic and optical storage
media and communication facilities.
Instruction set Architecture is programmer visible machine interface such as instruction set,
registers, memory organization and exception handling. Two main approaches are mainly
CISC (Complex Instruction Set Computer) and RISC (Reduced Instruction Set Computer)
Computer Organization includes the high level aspects of a design, such as memory system,
the bus structure and the design of the internal CPU.

Computer Types
Computer is a fast electronic calculating machine which accepts digital input, processes it
according to the internally stored instructions (Programs) and produces the result on the
output device. The internal operation of the computer can be as depicted in the figure below:

Figure 1: Fetch, Decode and Execute steps in a Computer System

Computer Organization Page 1


Computer Organization [IT II – I ]
The computers can be classified into various categories as given below:

 Micro Computer
 Laptop Computer
 Work Station
 Super Computer
 Main Frame
 Hand Held
 Multi core

Micro Computer: A personal computer; designed to meet the computer needs of an


individual. Provides access to a wide variety of computing applications, such as word
processing, photo editing, e-mail, and internet.

Laptop Computer: A portable, compact computer that can run on power supply or a battery
unit. All components are integrated as one compact unit. It is generally more expensive than a
comparable desktop. It is also called a Notebook.

Work Station: Powerful desktop computer designed for specialized tasks. Generally used for
tasks that requires a lot of processing speed. Can also be an ordinary personal computer
attached to a LAN (local area network).

Super Computer: A computer that is considered to be fastest in the world. Used to execute
tasks that would take lot of time for other computers. For Ex: Modeling weather systems,
genome sequence, etc (Refer site: http://www.top500.org/)

Main Frame: Large expensive computer capable of simultaneously processing data for
hundreds or thousands of users. Used to store, manage, and process large amounts of data that
need to be reliable, secure, and centralized.

Hand Held: It is also called a PDA (Personal Digital Assistant). A computer that fits into a
pocket, runs on batteries, and is used while holding the unit in your hand. Typically used as
an appointment book, address book, calculator and notepad.

Multi Core: Have Multiple Cores – parallel computing platforms. Many Cores or computing
elements in a single chip. Typical Examples: Sony Play station, Core 2 Duo, i3, i7 etc.

GENERATION OF COMPUTERS
Development of technologies used to fabricate the processors, memories and I/O units of
the computers has been divided into various generations as given below:
 First generation
 Second generation
 Third generation
 Fourth generation
 Beyond the fourth generation

Computer Organization Page 2


Computer Organization [IT II – I ]
First generation:
1946 to 1955: Computers of this generation used Vacuum Tubes. The computes were built using
stored program concept. Ex: ENIAC, EDSAC, IBM 701.
Computers of this age typically used about ten thousand vacuum tubes. They were bulky in
size had slow operating speed, short life time and limited programming facilities.

Second generation:
1955 to 1965: Computers of this generation used the germanium transistors as the active
switching electronic device. Ex: IBM 7000, B5000, IBM 1401. Comparatively smaller in
size About ten times faster operating speed as compared to first generation vacuum tube
based computers. Consumed less power, had fairly good reliability. Availability of large
memory was an added advantage.

Third generation:
1965 to 1975: The computers of this generation used the Integrated Circuits as the active
electronic components. Ex: IBM system 360, PDP minicomputer etc. They were still smaller
in size. They had powerful CPUs with the capacity of executing 1 million instructions per
second (MIPS). Used to consume very less power consumption.

Fourth generation:
1976 to 1990: The computers of this generation used the LSI chips like microprocessor as
their active electronic element. HCL horizen III, and WIPRO‟S Uniplus+ HCL‟s
Busybee PC etc.
They used high speed microprocessor as CPU. They were more user friendly and highly reliable
systems. They had large storage capacity disk memories.

Beyond Fourth Generation:


1990 onwards: Specialized and dedicated VLSI chips are used to control specific functions of
these computers. Modern Desktop PC‟s, Laptops or Notebook Computers.

Computer Organization Page 3


Computer Organization [IT II – I ]

Functional Unit

A computer in its simplest form comprises five functional units namely input unit, output unit
memory unit, arithmetic & logic unit and control unit. Figure 2 depicts the functional units of
a computer system.

Figure 2: Basic functional units of a computer

Let us discuss about each of them in brief:

1. Input Unit: Computer accepts encoded information through input unit. The
standard input device is a keyboard. Whenever a key is pressed, keyboard
controller sends the code to CPU/Memory.

Examples include Mouse, Joystick, Tracker ball, Light pen, Digitizer, Scanner etc.

2. Memory Unit: Memory unit stores the program instructions (Code), data
and results of computations etc. Memory unit is classified as:

 Primary /Main Memory

 Secondary /Auxiliary Memory

Computer Organization Page 4


Computer Organization [IT II – I ]
Primary memory is a semiconductor memory that provides access at high speed. Run
time program instructions and operands are stored in the main memory. Main memory
is classified again as ROM and RAM. ROM holds system programs and firmware
routines such as BIOS, POST, I/O Drivers that are essential to manage the hardware
of a computer. RAM is termed as Read/Write memory or user memory that holds run
time program instruction and data. While primary storage is essential, it is volatile in
nature and expensive. Additional requirement of memory could be supplied as
auxiliary memory at cheaper cost. Secondary memories are non volatile in nature.

3. Arithmetic and logic unit: ALU consist of necessary logic circuits like adder,
comparator etc., to perform operations of addition, multiplication, comparison of two
numbers etc.

4. Output Unit: Computer after computation returns the computed results, error
messages, etc. via output unit. The standard output device is a video monitor,
LCD/TFT monitor. Other output devices are printers, plotters etc.

5. Control Unit: Control unit co-ordinates activities of all units by issuing control
signals. Control signals issued by control unit govern the data transfers and then
appropriate operations take place. Control unit interprets or decides the
operation/action to be performed.

The operations of a computer can be summarized as follows:

1. A set of instructions called a program reside in the main memory of computer.

2. The CPU fetches those instructions sequentially one-by-one from the main memory,
decodes them and performs the specified operation on associated data operands in
ALU.

3. Processed data and results will be displayed on an output unit.

4. All activities pertaining to processing and data movement inside the computer
machine are governed by control unit.

Computer Organization Page 5


Computer Organization [IT II – I ]

Basic Operational Concepts


An Instruction consists of two parts, an Operation code and operand/s as shown below:

OPCODE OPERAND/s

Let us see a typical instruction


ADD LOCA, R0

This instruction is an addition operation. The following are the steps to execute the

instruction: Step 1: Fetch the instruction from main memory into the processor Step 2:
Fetch the operand at location LOCA from main memory into the processor
Step 3: Add the memory operand (i.e. fetched contents of LOCA) to the contents of register R0
Step 4: Store the result (sum) in R0.
The same instruction can be realized using two instructions as
Load LOCA,
R1 Add R1,
R0
The steps to execute the instructions can be enumerated as below:

Step 1: Fetch the instruction from main memory into the processor
Step 2: Fetch the operand at location LOCA from main memory
into
the processor Register R1
Step 3: Add the content of Register R1 and the contents of register R0
Step 4: Store the result (sum) in R0.

Computer Organization Page 6


Computer Organization [IT II – I ]
Figure 3 below shows how the memory and the processor are connected. As shown in the
diagram, in addition to the ALU and the control circuitry, the processor contains a number of
registers used for several different purposes. The instruction register holds the instruction that
is currently being executed. The program counter keeps track of the execution of the program.
It contains the memory address of the next instruction to be fetched and executed. There are n
general purpose registers R0 to Rn-1 which can be used by the programmers during writing
programs.

Figure 3: Connections between the processor and the memory

The interaction between the processor and the memory and the direction of flow of
information is as shown in the diagram below:

Figure 4: Interaction between the memory and the ALU

Computer Organization Page 7


Computer Organization [IT II – I ]

BUS STRUCTURES
Group of lines that serve as connecting path for several devices is called a bus (one bit per
line). Individual parts must communicate over a communication line or path for exchanging
data, address and control information as shown in the diagram below. Printer example –
processor to printer. A common approach is to use the concept of buffer registers to hold the
content during the transfer.

Figure 5: Single bus structure


SOFTWARE
If a user wants to enter and run an application program, he/she needs a System Software.
System Software is a collection of programs that are executed as needed to perform functions
such as:

 Receiving and interpreting user commands


 Entering and editing application programs and storing then as files in secondary
storage devices
 Running standard application programs such as word processors, spread sheets,
games etc…
Operating system - is key system software component which helps the user to exploit the
below underlying hardware with the programs.

USER PROGRAM and OS ROUTINE INTERACTION

Let‟s assume computer with 1 processor, 1 disk and 1 printer and application program is in
machine code on disk. The various tasks are performed in a coordinated fashion, which is
called multitasking. t0, t1 …t5 are the instances of time and the interaction during various
instances as given below:

t0: the OS loads the program from the disk to


memory t1: program executes
t2: program accesses disk
t3: program executes some
more t4: program accesses
printer
t5: program terminates

Computer Organization Page 8


Computer Organization [IT II – I ]

Figure 6 :User program and OS routine sharing of the


processor

PERFORMANCE
The most important measure of the performance of a computer is how quickly it can
execute programs. The speed with which a computer executes program is affected by
the design of its hardware. For best performance, it is necessary to design the compiles,
the machine instruction set, and the hardware in a coordinated way.
The total time required to execute the program is elapsed time is a measure of the
performance of the entire computer system. It is affected by the speed of the processor,
the disk and the printer. The time needed to execute a instruction is called the processor
time.
Just as the elapsed time for the execution of a program depends on all units in a
computer system, the processor time depends on the hardware involved in the execution
of individual machine instructions. This hardware comprises the processor and the
memory which are usually connected by the bus.
The pertinent parts of the fig. c is repeated in fig. d which includes the cache memory as
part of the processor unit.
Let us examine the flow of program instructions and data between the memory and the
processor. At the start of execution, all program instructions and the required data are
stored in the main memory. As the execution proceeds, instructions are fetched one by
one over the bus into the processor, and a copy is placed in the cache later if the same
instruction or data item is needed a second time, it is read directly from the cache.
The processor and relatively small cache memory can be fabricated on a single IC chip.
The internal speed of performing the basic steps of instruction processing on chip is
very high and is considerably faster than the speed at which the instruction and data can
be fetched from the main memory. A program will be executed faster if the movement
of instructions and data between the main memory and the processor is minimized,
which is achieved by using the cache.
Computer Organization Page 9
Computer Organization [IT II – I ]

For example:- Suppose a number of instructions are executed repeatedly over a short
period of time as happens in a program loop. If these instructions are available in the
cache, they can be fetched quickly during the period of repeated use. The same applies
to the data that are used repeatedly.

Processor clock:

Processor circuits are controlled by a timing signal called clock. The clock designer the
regular time intervals called clock cycles. To execute a machine instruction the
processor divides the action to be performed into a sequence of basic steps that each step
can be completed in one clock cycle. The length P of one clock cycle is an important
parameter that affects the processor performance.
Processor used in today‟s personal computer and work station have a clock rates that
range from a few hundred million to over a billion cycles per second.

Basic performance equation:

We now focus our attention on the processor time component of the total elapsed time.
Let „T‟ be the processor time required to execute a program that has been prepared
in some high-level language. The compiler generates a machine language object
program that corresponds to the source program. Assume that complete execution of the
program requires the execution of N machine cycle language instructions. The number
N is the actual number of instruction execution and is not necessarily equal to the
number of machine cycle instructions in the object program. Some instruction may be
executed more than once, which in the case for instructions inside a program loop others
may not be executed all, depending on the input data used.
Suppose that the average number of basic steps needed to execute one machine
cycle instruction is S, where each basic step is completed in one clock cycle. If clock
rate is „R‟ cycles per second, the program execution time is given by

T=N*S/R

this is often referred to as the basic performance equation.


We must emphasize that N, S & R are not independent parameters changing one may
affect another. Introducing a new feature in the design of a processor will lead to
improved performance only if the overall result is to reduce the value of T.

Performance measurements:

It is very important to be able to access the performance of a computer, comp designers


use performance estimates to evaluate the effectiveness of new features.
The previous argument suggests that the performance of a computer is given by the
execution time T, for the program of interest.
Inspite of the performance equation being so simple, the evaluation of „T‟ is highly
complex. Moreover the parameters like the clock speed and various architectural
features are not reliable indicators of the expected performance.
Hence measurement of computer performance using bench mark programs is done to
make comparisons possible, standardized programs must be used.

Computer Organization Page 10


Computer Organization [IT II – I ]

The performance measure is the time taken by the computer to execute a given bench
mark. Initially some attempts were made to create artificial programs that could be used
as bench mark programs. But synthetic programs do not properly predict the
performance obtained when real application programs are run.
A non profit organization called SPEC- system performance evaluation corporation
selects and publishes bench marks.
The program selected range from game playing, compiler, and data base applications to
numerically intensive programs in astrophysics and quantum chemistry. In each case,
the program is compiled under test, and the running time on a real computer is
measured. The same program is also compiled and run on one computer selected as
reference.
The „SPEC‟ rating is computed as follows.
Running time on the reference computer
SPEC rating =
Running time on the computer under test
If the SPEC rating = 50

Multiprocessor & microprocessors:

Large computers that contain a number of processor units are called multiprocessor
system. These systems either execute a number of different application tasks in parallel
or execute subtasks of a single large task in parallel. All processors usually have access
to all memory locations in such system & hence they are called shared memory
multiprocessor systems. The high performance of these systems comes with much
increased complexity and cost. In contrast to multiprocessor systems, it is also possible
to use an interconnected group of complete computers to achieve high total
computational power. These computers normally have access to their own memory units
when the tasks they are executing need to communicate data they do so by exchanging
messages over a communication network. This properly distinguishes them from shared
memory multiprocessors, leading to name message-passing multi computer.

Data Representation:
Information that a Computer is dealing with
Data
Numeric Data
Numbers( Integer, real)
Non-numeric Data
Letters, Symbols
Relationship between data elements
Data Structures
Linear Lists, Trees, Rings, etc
Program(Instruction)
Numeric Data Representation
Decimal Binary Octal Hexadecimal
Computer Organization Page 11
Computer Organization [IT II – I ]

00 0000 00 0
Fixed Point 01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Representation:
It‟s the representation for integers only where the decimal point is always fixed. i.e at
the end of rightmost point. it can be again represented in two ways.
1. Sign and Magnitude Representation
In this system, he most significant (leftmost) bit in the word as a sign bit. If the sign bit
is 0, the number is positive; if the sign bit is 1, the number is negative.
The simplest form of representing sign bit is the sign magnitude representation.
One of the draw back for sign magnitude number is addition and subtraction need to
consider both sign of the numbers and their relative magnitude.
Another drawback is there are two representation for 0(Zero) i.e +0 and -0.
2. One’s Complement (1’s) Representation
In this representation negative values are obtained by complementing each bit of the
corresponding positive number.
For example 1s complement of 0101 is 1010 . The process of forming the 1s
complement of a given number is equivalent to subtracting that number from 2n -1 i.e
from 1111 for 4 bit number.
Two‟s Complement (2‟s) Representation Forming the 2s complement of a number is
done by subtracting that number from 2n . So 2s complement of a number is obtained
by adding 1 to 1s complement of that number.
Ex: 2‟s complement of 0101 is 1010 +1 = 1011
NB: In all systems, the leftmost bit is 0 for positive number and 1 for negative number.

Floating-point representation
Floating-point numbers are so called as the decimal or binary point floats over the base

Computer Organization Page 12


Computer Organization [IT II – I ]

depending on the exponent value.


It consists two components.
• Exponent
• Mantissa
Example: Avogadro's number can be written as 6.02x1023 in base 10. And the mantissa
and exponent are 6.02 and 1023 respctivly. But computer floating-point numbers are
usually based on base two. So 6.02x1023 is approximately (1 and 63/64)x278 or
1.111111 (base two) x 21001110 (base two)
Error Detection Codes
Parity System
Hamming Distance
CRC
Check sum

Register Transfer Language And Micro Operations:


Register Transfer language:
 Digital systems are composed of modules that are constructed from digital
components, such as registers, decoders, arithmetic elements, and control logic
 The modules are interconnected with common data and control paths to form a
digital computer system
 The operations executed on data stored in registers are called microoperations
 A microoperation is an elementary operation performed on the information
stored in one or more registers
 Examples are shift, count, clear, and load
 Some of the digital components from before are registers that implement
microoperations
 The internal hardware organization of a digital computer is best defined by
specifying

o The set of registers it contains and their functions


o The sequence of microoperations performed on the binary information
stored
o The control that initiates the sequence of microoperations

 Use symbols, rather than words, to specify the sequence of microoperations


 The symbolic notation used is called a register transfer language
 A programming language is a procedure for writing symbols to specify a given
computational process
 Define symbols for various types of microoperations and describe associated
hardware that can implement the microoperations

Register Transfer

 Designate computer registers by capital letters to denote its function


 The register that holds an address for the memory unit is called MAR
 The program counter register is called PC

Computer Organization Page 13


Computer Organization [IT II – I ]

 IR is the instruction register and R1 is a processor register


 The individual flip-flops in an n-bit register are numbered in sequence from 0
to n-1
 Refer to Figure 4.1 for the different representations of a register

 Designate information transfer from one register


to another by R2 ◻ R1
 This statement implies that the hardware is available
o The outputs of the source must have a path to the inputs of the
destination
o The destination register has a parallel load capability
 If the transfer is to occur only under a predetermined control condition,
designate it by
If (P = 1) then (R2 ◻ R1)
or,
P: R2 ◻ R1,

Computer Organization Page 14


Computer Organization

where P is a control function that can be either 0 or 1

 Every statement written in register transfer notation implies


the presence of the required hardware construction

 It is assumed that all transfers occur during a clock edge transition


 All microoperations written on a single line are to be executed at
the same time T: R2 ◻ R1, R1 ◻R2

Computer Organization Page 15


Computer Organization

Bus and Memory Transfers

 Rather than connecting wires between all registers, a common bus is


used
 A bus structure consists of a set of common lines, one for each bit of
a register
 Control signals determine which register is selected by the
bus duringeach transfer
 Multiplexers can be used to construct a common bus
 Multiplexers select the source register whose binary information is
then placed on the bus
 The select lines are connected to the selection inputs of the
multiplexers and choose the bits of one register

 In general, a bys system will multiplex k registers of n bits each to


produce an n- line common bus
 This requires n multiplexers – one for each bit
 The size of each multiplexer must be k x 1
 The number of select lines required is log k
 To transfer information from the bus to a register, the bus lines
are connected to the inputs of all destination registers and the
corresponding load control line must be activated
 Rather than listing each step as
BUS ◻ C, R1 ◻ BUS,
use R1 ◻ C, since the bus isimplied

 Instead of using multiplexers, three-state gates can be used to

Computer Organization Page 16


Computer Organization

construct the bus system


 A three-state gate is a digital circuit that exhibits three states
 Two of the states are signals equivalent to logic 1 and 0
 The third state is a high-impedance state – this behaves like an open
circuit, which means the output is disconnected and does not have a
logic significance

 The three-state buffer gate has a normal input and a


control input which determines the output state
 With control 1, the output equals the normal input
 With control 0, the gate goes to a high-impedance state
 This enables a large number of three-state gate outputs to be
connected with wires to form a common bus line without endangering
loading effects

 Decoders are used to ensure that no more than one control input is
active at any given time
 This circuit can replace the multiplexer in Figure 4.3
 To construct a common bus for four registers of n bits each
using three-state buffers, we need n circuits with four buffers in
each
 Only one decoder is necessary to select between the four registers
 Designate a memory word by the letter M
 It is necessary to specify the address of M when

Computer Organization Page 17


Computer Organization
writing memory transfer operations

Computer Organization Page 18


Computer Organization

 Designate the address register by AR and the data register by DR


 The read operation can be stated as: Read: DR ◻ M[AR]
 The write operation can
be stated as:
Write: M[AR] ◻ R1

Arithmetic Microoperations

 There are four categories of the most common microoperations:


o Register transfer: transfer binary information from one
register to another
o Arithmetic: perform arithmetic operations on numeric
data stored in registers
o Logic: perform bit manipulation operations on non-numeric
data stored in registers
o Shift: perform shift operations on data stored in registers

 The basic arithmetic microoperations are addition,


subtraction, increment, decrement, and shift
 Example of addition: R3 ◻ R1+R2
 Subtraction is most often implemented through complementation and
addition
 Example of subtraction: R3 ◻ R1 +R2 + 1 (strikethrough denotes
bar on top – 1‟s complement of R2)
 Adding 1 to the 1‟s complement produces the 2‟s complement
 Adding the contents of R1 to the 2‟s complement of R2
is equivalent to subtracting

Computer Organization Page 19


Computer Organization

 Multiply and divide are not included as microoperations


 A microoperation is one that can be executed by one clock pulse
 Multiply (divide) is implemented by a sequence of add and
shift microoperations (subtract and shift)

 To implement the add microoperation with hardware, we need the


registers that hold the data and the digital component that
performs the addition
 A full-adder adds two bits and a previous carry
 A binary adder is a digital circuit that generates the arithmetic sum of
two binary numbers of any length
 A binary added is constructed with full-adder circuits connected in
cascade
 An n-bit binary adder requires n full-adders

 The subtraction A-B can be carried out by the following steps


o Take the 1‟s complement of B (invert each bit)

Computer Organization Page 20


Computer Organization

o Get the 2‟s complement by adding 1


o Add the result to A
 The addition and subtraction operations can be combined into one
common circuit by including an XOR gate with each full-adder

 The increment microoperation adds one to a number in a register


 This can be implemented by using a binary counter – every time
the count enable is active, the count is incremented by one
 If the increment is to be performed independent of a
particular register, then use half-adders connected in cascade
 An n-bit binary incrementer requires n half-adders

 Each of the arithmetic microoperations can be implemented in


one composite arithmetic circuit
 The basic component is the parallel adder
 Multiplexers are used to choose between the different operations
 The output of the binary adder is calculated from
the following sum: D = A + Y + Cin

Computer Organization Page 21


Computer Organization

Logic Microoperations

 Logic operations specify binary operations for strings of bits


stored in registers and treat each bit separately
 Example: the XOR of R1 and R2 is symbolized by
P: R1 ◻ R1⊕ R2
 Example: R1 = 1010 and R2 = 1100
1010 Content of R1
1100 Content of R2

Computer Organization Page 22


Computer Organization
0110 Content of R1 after P = 1

 Symbols used for logical microoperations:


o OR: ◻
o AND: ◻
o XOR: ⊕
 The + sign has two different meanings: logical OR and summation
 When + is in a microoperation, then summation
 When + is in a control function, then OR
 Example:
P + Q: R1 ◻ R2 + R3, R4 ◻ R5 ◻ R6
 There are 16 different logic operations that can be performed
with two binary variables

 The hardware implementation of logic microoperations requires that


logic gates be inserted for each bit or pair of bits in the registers

Computer Organization Page 23


Computer Organization

 All 16 microoperations can be derived from using four logic gates

 Logic microoperations can be used to change bit values, delete


a group of bits, or insert new bit values into a register
 The selective-set operation sets to 1 the bits in A where there are
corresponding 1‟s in B
1010 A before
1100 B
(logic
operand)
1110 A
after

A◻A◻B

 The selective-complement operation complements bits in A


where there are corresponding 1‟s in B
1010 A before
1100 B
(logic
operand)
0110 A
after

A ◻ A⊕ B
 The selective-clear operation clears to 0 the bits in A only
where there are corresponding 1‟s in B
1010 A before
1100 B
(logic

Computer Organization Page 24


Computer Organization

operand)
0010 A
after
A ◻ A ◻B

 The mask operation is similar to the selective-clear operation, except


that the bits of A are cleared only where there are corresponding 0‟s
in B
1010 A before
1100 B
(logic
operand)
1000 A
after
A◻A◻B
 The insert operation inserts a new value into a group of bits
 This is done by first masking the bits to be replaced and then
Oring them with the bits to be inserted
0110 1010 A before
0000 1111 B (mask)
0000 1010 A after masking

0000 1010 A before


1001 0000 B (insert)
1001 1010 A after insertion

 The clear operation compares the bits in A and B and produces an


all 0‟s result if the two number are equal
1010 A
1010 B
0000 A ◻ A⊕ B
Shift Microoperations

 Shift microoperations are used for serial transfer of data


 They are also used in conjunction with arithmetic, logic,
and other data- processing operations
 There are three types of shifts: logical, circular, and arithmetic
 A logical shift is one that transfers 0 through the serial input
 The symbols shl and shr are for logical shift-left and shift-right by
one position R1 ◻ shlR1

 The circular shift (aka rotate) circulates the bits of the


register around the two ends without loss of information
 The symbols cil and cir are for circular shift left and right

Computer Organization Page 25


Computer Organization

 The arithmetic shift shifts a signed binary number to the left or right
 To the left is multiplying by 2, to the right is dividing by 2
 Arithmetic shifts must leave the sign bit unchanged
 A sign reversal occurs if the bit in Rn-1 changes in value after the shift
 This happens if the multiplication causes an overflow
 An overflow flip-flop Vs can be used to detect
theoverflow Vs = Rn-1 ⊕Rn-2

 A bi-directional shift unit with parallel load could be used to


implement this
 Two clock pulses are necessary with this configuration: one to
load the value and another to shift
 In a processor unit with many registers it is more efficient
to implement the shift operation with a combinational
circuit
 The content of a register to be shifted is first placed onto a common
bus and the output is connected to the combinational shifter, the
shifted number is then loaded back into the register
 This can be constructed with multiplexers

Computer Organization Page 26


Computer Organization

Arithmetic Logic Shift Unit

 The arithmetic logic unit (ALU) is a common operational


unit connected to a number of storage registers
 To perform a microoperation, the contents of specified registers
are placed in the inputs of the ALU
 The ALU performs an operation and the result is then transferred to
a destination register
 The ALU is a combinational circuit so that the entire register
transfer operation from the source registers through the ALU and
into the destination register can be performed during one clock pulse
period

Computer Organization Page 27


Computer Organization

Computer Organization Page 28


Computer Organization

Computer Organization Page 29


Computer Organization
age can have a large impact on the number of page faults that occur.

Computer Organization Page 30

You might also like