Monday, May 3, 2010

Important Please

I have shifted all my posts to my Newly Created Blog:

http://nackednature.blogspot.com/




Sorry For Inconvinience

Wednesday, February 17, 2010

Microprocessor and its sub systems



Introduction

Today we want to learn about the microprocessor, the key component, the brain, of a computer

We’ll learn about the function of a microprocessor

And its various sub-systems

–Bus interface unit

–Data & instruction cache memory

–Instruction decoder

–Arithmetic-Logic unit

–Floating-point unit

–Control unit

Microprocessor

A microprocessor (abbreviated as µP or uP) is a computer processor on a microchip. It's sometimes called a logic chip. A microprocessor is designed to perform arithmetic and logic operations that make use of small number-holding areas called registers. Typical microprocessor operations include adding, subtracting, comparing two numbers, and fetching numbers from one area to another. These operations are the result of a set of instructions that are part of the microprocessor design. When the computer is turned on, the microprocessor is designed to get the first instruction from the basic input/output system (BIOS) that comes with the computer as part of its memory. After that, either the BIOS, or the operating system that BIOS loads into computer memory, or an application program is "driving" the microprocessor, giving it instructions to perform.
The number of transistors available has a huge effect on the performance of a processor. As seen earlier, a typical instruction in a processor like an 8088 took 15 clock cycles to execute. Because of the design of the multiplier, it took approximately 80 cycles just to do one 16-bit multiplication on the 8088. With more transistors, much more powerful multipliers capable of single-cycle speeds become possible.

A microprocessor is made from miniaturized transistors and other circuit elements on a single semiconductor integrated circuit (IC) . These are made up oof semiconductor and silicon.

Integrated circuit
  • Commonly known as an IC or a chip
  • A tiny piece of Silicon that has several electronic parts on it
  • Most of the size of an IC comes form the pins and packaging; the actual Silicon occupies a very small piece of the volume
  • The smallest components on an IC are much smaller than the thickness of a human hair

those components are

  • Devices
    • Transistors
    • Diodes
    • Resistors
    • Capacitors
    • Wires

    And are made of the following materials

    • Silicon - semiconductor
    • Copper - conductor
    Silicon Dioxide - insulator

A Microprocessor System

  • Microprocessors are powerful pieces of hardware, but not much useful on their own
  • Just as the human brain needs hands, feet, eyes, ears, mouth to be useful; so does the microprocessor
  • A microprocessor system is microprocessor plus all the components it requires to do a certain task
A microcomputer is 1 example of a microprocessor system


Micro Controller
  • Micro-controllers are another type of microprocessor systems
  • They are generally not that powerful, cost a few dollars a piece, and are found embedded in video games, VCRs, microwave ovens, printers, autos, etc.
They are a complete computer on a chip containing direct input and output capability and memory along with the microprocessor on a single chip. Many times they contain other specialized application-specific components as well

Question
Why do we ever build just microprocessors ?
Why not just build micro-controllers that contain everything on chip?

The Main Memory Bottleneck
  • Modern super-fast microprocessors can process a huge amount of data in a short duration
  • They require quick access to data to maximize their performance
  • If they don’t receive the data that they require, they literally stop and wait – this results in reduced performance and wasted power
  • Current microprocessors can process an instruction in about a ns. Time required for fetching data from main memory (RAM) is of the order of 100 ns

Solution to the Bottleneck Problem

  • Make the main memory faster
  • Problem with that approach: The 1-ns memory is extremely expensive as compared the currently popular 100-ns memory
  • Another solution: In addition to the relatively slow main memory, put a small amount of ultra-fast RAM right next to the microprocessor on the same chip and make sure that frequently used data and instructions resides in that ultra-fast memory
Advantage: Much better overall performance due to fast access to frequently-used data and instructions

On-Chip Cache Memory

  • That small amount of memory located on the same chip as the microprocessor is called On-Chip Cache Memory
  • The microprocessor stores a copy of frequently used data and instructions in its cache memory
  • When the microprocessor desires to look at a piece of data, it checks in the cache first. If it is not there, only then the microprocessor asks for the same from the main memory
  • The small size and proximity to the microprocessor makes access times short, resulting in a boost in performance (it is easy to find things in a small box placed next to you)
  • Microprocessors predict what data will be required for future calculations and pre-fetches that data and places it in the cache so that it is available immediately when the need arises
The speed-advantage of cache memory is greatly dependent on the algorithm used for deciding about what to put in cache or not





Bus Interface Unit

The bus interface unit is the part of the processor that interfaces with the rest of the PC. Its name comes from the fact that it deals with moving information over the processor data bus, the primary conduit for the transfer of information to and from the CPU. The bus interface unit is responsible for responding to all signals that go to the processor, and generating all signals that go from the processor to other parts of the system.

It receives instructions & data from main memory to be processed and operations. After the operations are processed it then sends back the information (processed data) to the cache. It also receives the processed data to send it to the main memory.

Instruction Decoder

The instruction decoder of a processor is a combinatorial circuit sometimes in the form of a read-only memory, sometimes in the form of an ordinary combinatorial circuit. Its purpose is to translate an instruction code into the address in the micro memory where the micro code for the instruction starts.

A decoder is a device which is the reverse, undoing the encoding so that the original information can be retrieved. The same method used to encode is usually just reversed in order to decode.This unit receives the programming instructions and decodes them into a form that is understandable by the processing units, i.e. The ALU or FPU Then, it passes on the decoded instruction to the ALU or FPUs as desired.


Microprocessor Building Blocks

Arithmetic & Logic Unit (ALU)

An arithmetic and logical unit (ALU) also known as “Integer Unit” is one of the core components of all central processing units. It is capable of calculating the results of a wide variety of common computations. The most common available operations are the integer arithmetic operations of addition, subtraction, and multiplication, the bitwise logic operations of AND, NOT, OR, and XOR, and various shift operations.

The ALU takes as inputs the data to be operated on and a code from the control unit indicating which operation to perform, and for output provides the result of the computation. In some designs it may also take as input and output a set of condition codes, which can be used to indicate cases such as carry-in or carry-out, overflow, or other statuses.

The new breed of popular microprocessors have not one but two almost identical ALU’s that can do calculations simultaneously, doubling the capability

Floating-Point Unit (FPU)

A floating point unit (FPU) is a part of a CPU specially designed to carry out operations on floating point numbers. Typical operations are floating point arithmetic (such as addition and multiplication), but some systems may be capable of performing exponential or trigonometric calculations as well (such as square roots or cosines).

Not all CPUs have a dedicated FPU. In the absence of an FPU, the CPU may use a microcode program to emulate an FPUs function using an arithmetic and logical unit (ALU), which saves the added hardware cost of an FPU but is significantly slower.

In some computer architectures, floating point operations are handled completely separate from integer operations, with dedicated floating point registers and independent clocking schemes. Floating point addition and multiplication operations are typically pipelined, but more complicated operations, like division, may not be, and some systems may even have a dedicated floating point divider circuit.

Registers

A register is a device for storing data. It is a small amount of very fast computer memory used to speed the execution of computer programs by providing quick access to commonly used values. These registers are the top of the memory hierarchy, and are the fastest way for the system to manipulate data. It is common to measure registers by the number of bits it can hold, for example, an "8-bit register" or "32-bit register".

Registers are now usually implemented as an array of SRAMs, but they have also been implemented using individual flip flops, high speed core memory, thin film memory, and other ways in various machines.

There are several other classes of registers:

Data registers are used to store integer numbers.

Address registers hold memory addresses and are used to access memory.

General Purpose registers can store both data and addresses.

Floating Point registers are used to store floating point numbers.

Constant registers hold read-only values (e.g zero or one).

Vector registers hold data for Single Instruction Multiple Data (SIMD) instructions.

Special Purpose registers which store internal CPU data like the stack pointer or processor status words.

The ALU & FPU store intermediate and final results from their calculations in these registers. Then the processed data goes back to the data cache and then to main memory from these registers.

Control Unit

A control unit is the part of a CPU or other device that directs its operation. The outputs of the unit control the activity of the rest of the device. A control unit can be thought of as a finite state machine. It is called the brain of computer microprcessor. It manages whole process of the microprocessor. For it identifes which data is sent to the ALU or memory etc.

At one time control units for CPUs were ad-hoc logic, and they were difficult to design. Now they are often implemented as a microprogram that is stored in a control store.

Instruction Set
  • The set of machine instructions that a microprocessor recognizes and can execute – the only language microprocessor knows
  • An instruction set includes low-level, a single step-at-a-time instructions, such as add, subtract, multiply, and divide
  • Each microprocessor family has its unique instruction set
Bigger instruction-sets mean more complex chips (higher costs, reduced efficiency), but shorter programs

The 1st microprocessor : Intel 4004
  • Introduced 1971
  • 2250 transistors
  • 108 kHz, 60,000 ops/sec
  • 16 pins
  • 10-micron process
  • As powerful as the ENIAC which had 18000 tubes and occupied a large room
  • Targeted use: Calculators
  • Cost: less than $100

Why Intel came up with the idea?

  • A Japanese calculator manufacturer – Busicom – wanted Intel to develop 16 separate IC’s for a line of new calculators
  • Intel, at that point in time known only as a memory manufacturer, was quite small and did not have the resources to do all 16 chips
  • Ted Hoff came up with the idea of doing all 16 on a single chip
  • Later, Intel realized that the 4004 could have other uses as well
Currently Popular Intel Pentium 4 (2.2GHz)
  • Introduced December 2001
  • 55 million transistors
  • 32-bit word size
  • 2 ALU’s, each working at 4.4GHz
  • 128-bit FPU
  • 0.13 micron process
  • Targeted use: PC’s and low-end workstations
  • Cost: around $600
Moore’s Law
  • In 1965, one of the founders of Intel – Gordon Moore – predicted that the number of transistor on an IC (and therefore the capability of microprocessors) will double every year. Later he modified it to 18-months
His prediction still holds true in ‘02. In fact, the time required for doubling is contracting to the original prediction, and is closer to a year now

Evolution of Intel Microprocessors


4-, 8-, 16-, 32-, 64-bit (Word Length)

The 4004 dealt with data in chunks of 4-bits at a time

Pentium 4 deals with data in chunks (words) of 32-bit length

The new Itanium processor deals with 64-bit chunks (words) at a time

kHz, MHz, GHz (Clock Frequency)

4004 worked at a clock frequency of 108kHz

The latest processors have clock freqs. in GHz

Out of 2 microprocessors having similar designs, one with higher clock frequency will be more powerful

Same is not true for 2 microprocessors of dissimilar designs. Example: Out of PowerPC & Pentium 4 microprocessors working at the same freq, the former performs better due to superior design. Same for the Athlon microprocessor when compared with a Pentium


Enhancing the capability of a microprocessor

The computing capability of a microprocessor can be enhanced in many different ways:

  • By increasing the clock frequency
  • By increasing the word-width
  • By having a more effective caching algorithm and the right cache size
  • By adding more functional units (e.g. ALU’s, FPU’s, Vector/SIMD units, etc.)
Improving the architecture

What have we learnt today?

Today we learnt about the microprocessor, the key component, the brain, of a computer

We’ll learn about the function of a microprocessor

And its various sub-systems

–Bus interface unit

–Data & instruction cache memory

–Instruction decoder

–Arithmetic-Logic unit

–Floating-point unit

–Control unit