cpu alu cu

22
CONTENTS TITLE PAGE NO. 1 Introduction 1 2 Central processing unit 2 2.1 How CPU performs? 2 2.2 CPU Components 3 2.3 Measuring speed 3 2.3.1.1 Bit Width 3 2.3.2 Clock Cycle 4 2.3.3 Execution core 4 3 Arithmetic Logic unit 6 3.1 Logical and fixed point binary operations 7 3.2 Logical operations 8 4 Control Unit 8 4.1 Types of Control Units 10 4.1.1 Hardwired control unit 10 4.1.2 Micro programmed control unit 10 5 Bus 11 5.1 Bus types 11

Upload: wasif28

Post on 07-Apr-2015

1.442 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CPU ALU CU

CONTENTS

TITLE PAGE NO.

1 Introduction 1

2 Central processing unit 2

2.1 How CPU performs? 2

2.2 CPU Components 3

2.3 Measuring speed 3

2.3.1.1 Bit Width 3

2.3.2 Clock Cycle 4

2.3.3 Execution core 4

3 Arithmetic Logic unit 6

3.1 Logical and fixed point binary operations 7

3.2 Logical operations 8

4 Control Unit 8

4.1 Types of Control Units 10

4.1.1 Hardwired control unit 10

4.1.2 Micro programmed control unit 10

5 Bus 11

5.1 Bus types 11

5.1.1 The system bus 12

5.1.2 The control bus 12

Conclusion 13

Appendices 14

Page 2: CPU ALU CU

1. Introduction

In any computer system, there are three main components:

1) CPU

It is the central processing unit. It process all the data.

2) ALU

ALU is the arithmetic logic unit. It does all the arithmetic calculations.

3) CU

CU is the control unit. It co-ordinates between other units.

4) BUS

The Bus is responsible to transport data to all the components and from all the

components.

Page 3: CPU ALU CU

2. CENTRAL PROCESSING UNIT

The Central Processing Unit (CPU) is the brain of the computer--it is the 'compute' in

computer. Modern CPU's are what are called 'integrated chips'. The idea of an

integrated chip is that several processing components are integrated into a single piece

of silicon. Without the CPU, you have no computer. The CPU is composed of thousands

(and soon billions) of transistors.

Each transistor is a set of inputs and one output. When one

or more of the inputs receive electricity, the combined

charge changes the state of the transistor internally and you

get a result out the other side. This simple effect of the

transistor is what makes it possible for the computer to

count and perform logical operations, all of which we call

processing.

A modern computer's CPU usually contains an execution core with two or more

instruction pipelines, a data and address bus, a dedicated arithmetic logic unit (ALU,

also called the math co-processor), and in some cases special high-speed memory for

caching program instructions from RAM.

The CPU's in most PC's and servers are general purpose integrated chips composed of

several smaller dedicated-purpose components which together create the processing

capabilities of the modern computer.

For example, Intel makes a Pentium, while AMD makes the Athlon, and Duron (no

memory cache).

2.1 HOW CPU PERFORMS?

CPU performs its tasks in a cycle of four steps. This cycle is known as machine cycle.

Following are the steps included in machine cycle: -

1) Fetching

Fetching is the process of obtaining program instructions or data from the

memory.

2) Decoding

Page 4: CPU ALU CU

Decoding refers to the process of translating instructions into the signals the

computer can execute

3) Executing

Executing is the process of carrying out the commands.

4) Storing

Storing is the process in which results are stored in the memory.

2.2 CPU Components

A lot of components go into building a modern computer processor and just what goes

in changes with every generation as engineers and scientists find new, more efficient

ways to do old tasks.

Execution Core(s)

Data Bus

Address Bus

Math Co-processor

Instruction sets / Microcode

Multimedia extensions

Registers

Flags

Pipelining

Memory Controller

Cache Memory (L1, L2 and L3)

2.3 Measuring Speed: Bits, Cycles and Execution Cores

2.3.1 Bit Width

The first way of describing a processor is to say how many bits it processes in a single

instruction or transports across the processor's internal bus in a single cycle (not exactly

correct, but close enough). The number of bits used in the CPU's instructions and

registers and how many bits the buses can transfer simultaneously is usually expressed

an multiples of 8 bits. It is possible for the registers and the bus to have different sizes.

Current chip designs are 64 bit chips (as of 2008).

More bits usually means more processing capability and more speed.

Page 5: CPU ALU CU

2.3.2 Clock Cycles

The second way of describing a processor is to say how many cycles per second the

chip operates at. This is how many times per second a charge of electricity passes

through the chip. The more cycles, the faster the processor. Currently, chips operate in

the billions of cycles per second range. When you're talking about billions of anything

in computer terms, you're talking about 'giga' something. When you're talking about

how many cycles per second, you are talking about 'hertz'. Putting the two together, you

get gigahertz.

More clock cycles usually means more processing capability and more speed.

2.3.3Execution Cores

The third way of describing a processor is to say how many execution cores are in the

chip. The most advanced chips today have eight execution cores. More execution cores

means you can get more work done at the same time,

but it doesn't necessarily mean a single program will

run faster. To put it another way, a processor with

one execution core might be able to run your MP3

music, your web browser, a graphics program and

that's about where it starts to slow down enough, it's

not worth it running more programs. A system with

a processor with 8 cores could run all that plus ten more applications without even

seeming to slow down (of course, this assumes you have enough RAM to load all of this

software at the same time). More execution cores means more processing capability, but

not necessarily more speed.

The following table helps you to understand the differences between the different

processors that Intel has introduced over the years.

Name Date Transistors MicronsClock

speed

Data

widthMIPS

8080 1974 6,000 6 2 MHz 8 bits 0.64

8088 1979 29,000 3 5 MHz 16 bits 0.33

Page 6: CPU ALU CU

8-bit bus

80286 1982 134,000 1.5 6 MHz 16 bits 1

80386 1985 275,000 1.5 16 MHz 32 bits 5

80486 1989 1,200,000 1 25 MHz 32 bits 20

Pentium 1993 3,100,000 0.8 60 MHz

32 bits

64-bit

bus

100

Pentium II 1997 7,500,000 0.35 233 MHz

32 bits

64-bit

bus

~300

Pentium III 1999 9,500,000 0.25 450 MHz

32 bits

64-bit

bus

~510

Pentium 4 2000 42,000,000 0.18 1.5 GHz

32 bits

64-bit

bus

~1,700

Pentium 4

"Prescott"2004 125,000,000 0.09 3.6 GHz

32 bits

64-bit

bus

~7,000

Information about this table:

The date is the year that the processor was first introduced. Many processors are

re-introduced at higher clock speeds for many years after the original release

date.

Transistors is the number of transistors on the chip. You can see that the

number of transistors on a single chip has risen steadily over the years.

Microns is the width, in microns, of the smallest wire on the chip. For

comparison, a human hair is 100 microns thick. As the feature size on the chip

goes down, the number of transistors rises.

Clock speed is the maximum rate that the chip can be clocked at. Clock speed

will make more sense in the next section.

Page 7: CPU ALU CU

Data Width is the width of the ALU. An 8-bit ALU can

add/subtract/multiply/etc. two 8-bit numbers, while a 32-bit ALU can

manipulate 32-bit numbers. An 8-bit ALU would have to execute four

instructions to add two 32-bit numbers, while a 32-bit ALU can do it in one

instruction. In many cases, the external data bus is the same width as the ALU,

but not always. The 8088 had a 16-bit ALU and an 8-bit bus, while the modern

Pentiums fetch data 64 bits at a time for their 32-bit ALUs.

MIPS stands for "millions of instructions per second" and is a rough measure of

the performance of a CPU. Modern CPUs can do so many different things that

MIPS ratings lose a lot of their meaning, but you can get a general sense of the

relative power of the CPUs from this column.

3. ARITHMETIC LOGIC UNIT

The computer’s arithmetic/logic unit (ALU) was designed to perform addition,

complementation, and single-bit shift operations on 16-bit binary data, in parallel. The

four basic arithmetic operations (addition, subtraction, multiplication, and division) can

be performed using this ALU and appropriate software routines. Advances in IC

technology have made it practical to implement most of the ALU functions required in

hardware, thereby minimizing the software implementation and increasing the speed.

The majority of modern-day processors use bit-parallel ALUs. It is possible to use a bit-

serial ALU where slow operations are acceptable. For example, in a calculator IC, serial

arithmetic may be adequate due to the slow nature of human interaction with the

calculator. In building processors on single ICs, a considerable amount of silicon ‘‘real

estate’’ can be conserved by using a serial ALU. The silicon area thus saved can be used

in implementing other complex operations that may be required.

Logical Operation Meaning

AND Perform the logical ANDing of two operands

OR Perform the logical ORing of two operands

XOR Perform the XORing of two operands

NOT Perform the complement of an operand

Page 8: CPU ALU CU

COMPARE Perform logical comparison of two operands and set flag

accordingly

SHIFT Perform logical shift (right or left) of the content of a register

ROTATE Perform logical shift (right or left) with wraparound of the

content of a register

Some common logical operation

The most common operands an ALU deals with are: binary (fixed- and floating-point),

decimal, and character strings. We will describe the ALU enhancements that facilitate

fixed-point binary and logical data manipulation in the next section.It is now common

to see either multiple functional units within an ALU or multiple ALUs within the CPU.

Figure below shows   a representative   block   diagram   of   an   ALU   of   a

microcomputer.

3.1 LOGICAL AND FIXED-POINT BINARY OPERATIONS

ALU is designed to perform a single-bit right or left shift. Other types of shift

operations are useful in practice. The parallel binary adder used in ASC ALU is slow,

since the carry has to ripple from the least significant bit to the most significant bit

before the addition is complete. Several algorithms for fast addition have been devised.

We will describe one such algorithm

Page 9: CPU ALU CU

in this section. Various multiplication and division schemes have been devised; we will

describe the popular ones.

3.2 Logical Operations

The single-bit shifts performed by the ASC ALU are called arithmetic shift operations

since the results of shift conformed to the 2s complement arithmetic used by the ALU.

In practical ALUs, it is common to see the following additional types of arithmetic shift

operations:

Logical operations such as AND, OR, EXCLUSIVE OR, and NOT are also useful ALU

functions. The operands for these operations could be the contents of registers and/or

memory locations.

4. CONTROL UNIT

Page 10: CPU ALU CU

The control unit maintains order within the computer system and directs the flow of

traffic (operations) and data. The control unit selects one program statement at a time

from the program storage area, interprets the statement, and sends the appropriate

electronic impulses to the arithmetic logic unit and storage section to cause them to

carry out the instruction. The control unit does not perform the actual processing

operations on the data. Specifically, the control unit manages the operations of the CPU,

be it a single chip microprocessor or a fill-size mainframe. Like a traffic director, it

decides when to start and stop (control and timing), what to do (program instructions),

where to keep information (memory), and with what devices to communicate (I/O). It

controls the flow of all data entering and leaving the computer. It accomplishes this by

communicating or interfacing with the arithmetic logic unit, memory, and I/O areas. It

provides the computer with the ability to function under program control. Depending on

the design of the computer, the CPU can also have the capability to function under

manual control through man/machine interfacing. The control unit consists of several

basic logically defined areas. These logically defined areas work closely with each

other. Timing in a computer regulates the flow of signals that control the operation of

the computer. The instruction and control portion makes up the decision-making and

memory-type functions.

Block diagram of Control Unit

Addressing is the process of locating the operand (specific   information) for a given

operation.  An interrupt is a break in the normal flow of operation of a computer (e.g.,

CTRL  +  ALT  +  DEL). Control memory is a random-access memory (RAM)

consisting of addressable storage registers. Cache memory is a small, high-speed RAM

Page 11: CPU ALU CU

buffer located between the CPU and main memory; it can increase the speed of the PC.

Read-only memory (ROM) are chips with a set of software instructions supplied by the

manufacturer built into them that enables the computer to perform its I/O operations.

The control unit is also capable of shutting down the computer when the power supply

detects abnormal conditions.

The control unit is the most complex block of computer hardware from a designer’s

point of view. Its function is to generate control signals needed by other blocks of the

machine in a predetermined sequence to bring about the sequence of actions called for

by each instruction.

4.1 Types of Control Units

The function of the control unit is to generate the control signals in the appropriate

sequence to bring about the instruction cycle that corresponds to each instruction in the

program. In ASC an instruction cycle consists of three phases. Each phase in the

instruction cycle is composed of a sequence of micro operations. A micro operation is

one of the following:

1. A simple register transfer operation: the transfer of contents of one register to the

other register.

2. A complex register transfer involving ALU, such as the transfer of the complement of

the contents of a register, the sum of the contents of two registers, etc. to the destination

register.

3. A memory read or write operation. Thus, a machine instruction is composed of a

sequence of micro operations (i.e., a register transfer sequence).

The CU can be implemented in two popular schemes:

4.1.1 Hardwired control unit (HCU)

The outputs (control signals) of the CU are generated by the logic circuitry built of gates

and flip flops.

4.1.2 Micro programmed control unit (MCU)

The sequence of micro operations corresponding to each machine instruction are stored

in a read-only memory called control ROM (CROM). The sequence of micro operations

is called the micro program, and the micro program consists of microinstructions. A

microinstruction corresponds to one or more micro operations, depending on the CROM

storage format.

Page 12: CPU ALU CU

The MCU scheme is more flexible than the HCU scheme because in it the meaning of

an instruction can be changed by changing the microinstruction sequence corresponding

to that instruction, and the instruction set can be extended simply by including a new

ROM containing the corresponding micro operation sequences. Hardware changes to

the control unit thus are minimal in this implementation. In an HCU, any such change to

the instruction set requires substantial changes to the hardwired logic. HCUs, however,

are generally faster than MCUs and are used where the control unit must be fast. Most

of the more recent machines have micro programmed control units.

Among the machines that have an MCU, the degree to which the micro program can be

changed by the user varies from machine to machine. Some do not allow the user to

change the micro program, some allow partial changes and additions (for example,

machines with writable control store), and some do not have an instruction set of their

own and allow the user to micro program the complete instruction set suitable for his

application. This latter type of machine is called a soft machine.

5. Bus

The functional units are interconnected to enable data transport (e.g., write CPU register

data content to a certain address in memory)

• The unit ←→unit interconnections are referred to as a bus

– Bus: a bundle of conductors (wires/tracks) layed out on the motherboard

(Bus width = number of conductors in bundle)

• Data and addresses are communicated on separate data and address

Busses (history: e.g., Intel 8086 used shared data/address bus)

Examples

CPU Address Bus Width Data Bus Width

Intel Pentium IV 32 64

Intel Itanium 44 64

5.1 Bus types:

1 Data bus (move data)

Page 13: CPU ALU CU

2 Address bus (select address in memory, select port in I/O unit)

3 Control bus (synchronize units, request action from unit, unit state)

• The busses provide an infrastructure that is shared by all units. There are

No individual unit←→ unit (point-to-point) interconnections

(exception: interrupt request lines)

5.1.2 The System Bus

The system bus connects the microprocessors to the memory and I/O subsystems

It is comprised of three major busses: The address bus, the data bus, and the

control bus

Both address and data busses come in variety of sizes.

Address busses generally range from 20 to 36 bits

(1 MB address space – 64 GBytes)

Data busses are either 8, 16, 32, or 64 bits wide

The control bus on the other hand varies amongst processors. It is a collection of

control signals with which the processor communicates with the rest of the

system

5.1.3 The Control Bus

The following are generally part of the Control Bus:

Read/Write signal, which specify the direction of data flow

Byte Enable signals, which allow 16, 32, and 64 bit busses deal with smaller

chunks of data

Page 14: CPU ALU CU

Some processors have signalling which identifies between memory and I/O

addresses

Other signals include interrupt lines, parity lines, bus clock, and status signals

CONCLUSION

CPU

CPU is the brain of the computer. It is the main chip that is fixed on the motherboard.

CPU is also called as microprocessor. CPU reads and executes the program instructions,

perform calculation and make decisions. It is also responsible for storing and retrieving

information on the storage disks or other storage media. It also handles the flow of

information from one part of the computer to another.

ALU

ALU performs the following functions:

The arithmetic logic unit executes the arithmetic and logical operations.

Arithmetic operation include Addition, subtract, multiplication and division.

ALU performs logical operation in which it compares two numbers, letter or

special characters.

ALU compares the following conditions:

CU

Control unit, controls and co-ordinates among the other components of CPU. It

performs the following functions:

Sends data and instructions received from input devices to the memory.

Sends the data and information from memory to the ALU.

Sends the processed data or information from ALU, back to the memory.

Transfers the processed data or information from memory to the output unit.

BUS

Page 15: CPU ALU CU

A bus in computer terminology represents a physical connection used to carry a

signal from one point to another. The signal carried by a bus may represent address,

data, control signal, or power. Typically, a bus consists of a number of connections

running together. Each connection is called a bus line.

APPENDICES

Websites

http://www.intel.com/

http://www.inetdaemon.com/

http://www.tpub.com/

Books

Computer Design And Architecture By Sajjan G. Shiva

Fundamentals of Computer Organization and Architecture By Mostafa Abd-El-Barr &

Hisham El-Rewini