Spread Knowledge

CS101 - Introduction to Computing - Lecture Handout 07

User Rating:  / 0

Related Content: CS101 - VU Lectures, Handouts, PPT Slides, Assignments, Quizzes, Papers & Books of Introduction to Computing

Goals for Today

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


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 Circuits

A chip is also called an (integrated circuit (IC) (aka microchip or just chip). It is a microelectronic semiconductor device consisting of many interconnected transistors and other components.Generally it is a small, thin piece of silicon onto which the transistors making up the microprocessor have been etched.
A chip might be as large as an inch on a side and can contain tens of millions of transistors. Simpler processors might consist of a few thousand transistors etched onto a chip just a few millimeters square. Integrated circuits can be classified into analog, digital and mixed signal (both analog and digital on the same chip). Digital integrated circuits can contain anything from one to millions of logic gates, flip-flops, multiplexers, etc. in a few square millimeters. The small size of these circuits allows high speed, low power dissipation, and reduced manufacturing cost compared with board-level integration.
The growth of complexity of integrated circuits follows a trend called "Moore's Law", it states that the number of transistors in an integrated circuit doubles every two years.
Integrated circuits can be classified into analog, digital and mixed signal (both analog and digital on the same chip). Digital integrated circuits can contain anything from one to millions of logic gates, flip-flops, multiplexers, etc. in a few square millimeters. The small size of these circuits allows high speed, low power dissipation, and reduced
manufacturing cost compared with board-level integration.



The transistor is a solid state semiconductor device used for amplification and switching, and has three terminals. A small current or voltage applied to one terminal controls the current through the other two, hence the term transistor; a voltage- or current-controlled resistor. It is the key component in all modern electronics. In digital circuits, transistors are used as very fast electrical switches, and arrangements of transistors can function as logic gates, RAM-type memory and other devices. In analog circuits, transistors are essentially used as amplifiers.


A diode functions as the electronic version of a one-way valve. By restricting the direction of movement of charge carriers, it allows an electric current to flow in one direction, but blocks it in the opposite direction.
A diode's current-voltage, or I-V, characteristic can be approximated by two regions of operation. Below a certain difference in potential between the two leads, the diode can be thought of as an open (non-conductive) circuit. As the potential difference is increased, at some stage the diode will become conductive and allow current to flow, at
which point it can be thought of as a connection with zero (or at least very low) resistance. In a typical semiconductor p-n diode, conventional current can flow from the p-doped side to the n-doped side, but not in the opposite direction. When the diode is reverse-biased, the charge carriers are pulled away from the center of the device, creating a depletion region. More specifically, the transfer function is logarithmic, but so sharp that it looks like a corner.


A resistor is an electrical component designed to have an electrical resistance that is independent of the current flowing through it. The common type of resistor is also designed to be independent of temperature and other factors. Resistors may be fixed or variable. Variable resistors are also called potentiometers or rheostats A few resistor types
Some resistors are long and thin, with the actual resisting material in the centre, and a conducting metal leg on each end. This is called an axial package.
Resistors used in computers and other devices are typically much smaller, often in surfacemount (Surface-mount technology) packages without leads.
Larger power resistors come in more sturdy packages designed to dissipate heat efficiently, but they are all basically the same structure. Resistors are used as part of electrical networks and incorporated into microelectronic semiconductor devices. The critical measurement of a resistor is its resistance, which serves as a ratio of voltage to
current and is measured in ohms, an SI unit. Any physical object is a kind of resistor.
Most metals are conductors, and have low resistance to the flow of electricity. The human body, a piece of plastic, or even a vacuum has a resistance that can be measured.
Materials that have very high resistance are called insulators.


A capacitor (historically known as a "condenser") is a device that stores energy in an electric field, by accumulating an internal imbalance of electric charge. An ideal capacitor can store electronic energy when disconnected from its charging circuit, so it can be used like a fast battery. In AC or signal circuits it induces a phase difference of 90 degrees, current leading potential.
They are connected in parallel with the power circuits of most electronic devices and larger systems (such as factories) to shunt away and conceal current fluctuations from the primary power source to provide a "clean" power supply for signal or control circuits. The effect of such capacitors can be thought of in two different ways. One way
of thinking about it is that the capacitors act as a local reserve for the DC power source, to smooth out fluctuations by charging and discharging each cycle. The other way to think about it is that the capacitor and resistance of the power supply circuitry acts as a filter and removes high frequencies, leaving only DC.

And are made of the following materials

Silicon - semiconductor
Copper - conductor
Silicon Dioxide - insulator

Microprocessor system

Microprocessors are powerful pieces of hardware, but not much useful on their own.
They do not have the sense of their own. Like the human sample it needs some instructions inputs and outputs to process some task. As per instruction given to the microprocessor.
A microprocessor system is microprocessor plus all the components it requires to do a certain task.
Shortly, a microprocessor needs help of some components to make up the task to fulfill.
These components are input, output, storage, and memory. All these components and microprocessor make up a microprocessor system.
Personal Computer is an example of microprocessor System. Another example is the microcontroller.


A microcontroller is a microprocessor optimised to be used to control electronic equipment. Microcontrollers represent the vast majority of all computer chips sold, over 50% are "simple" controllers, and another 20% are more specialized decipline processors. While you may have one or two general-purpose microprocessors in your
house (you're using one to read this), you likely have somewhere between one and two dozen microcontrollers. They can be found in almost any electrical device, washing machines, microwave ovens, telephones etc.
A microcontroller includes CPU, memory for the program (ROM), memory for data (RAM), I/O lines to communicate with peripherals and complementary resources, all this in a closed chip. A microcontroller differs from a standalone CPU, because the first one generally is quite easy to make into a working computer, with a minimum of external support chips. The idea is that the microcontroller will be placed in the device to control, hooked up to power and any information it needs, and that's that.

The Main Memory Bottleneck

Modern super-fast microprocessors can process a huge amount of data in a short duration. They need data to be processed at the same speed. Other wise they have to sit idle and wait for the input/data, because speed of input is rather small then processing of data. 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 ns (nanosecond). Time required for fetching data from main memory (RAM) is of the order of 100 ns

Solution to the Bottleneck Problem

In order to eliminate the solution it was suggested to make the main memory faster. But that evolved a problem that the 1-ns memory is extremely expensive as compared the currently popular 100-ns memory.
Finally it was decided that 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 It increases the performance. It supports better over performance due to fast access to frequently used data and instructions.


A cache is a collection of duplicate data, where the original data is expensive to fetch or compute (usually in terms of access time) relative to the cache. Future accesses to the data can be made by accessing the cached copy rather than refetching or recomputing the original data, so that the perceived average access time is lower. Caches may mark the cached data as 'stale' when the original data is changed, but this is not always the case.

On-Chip Cache Memory (1)

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

On-Chip Cache Memory (2)

L2, cache memory, which is on a separate chip from the microprocessor but faster to access than regular RAM.
It is the small size and proximity to the microprocessor makes access times short, resulting in a boost in performance. Microprocessors predict what data will be required for future calculations and it pre-fetches that data and places it in the cache so that it is available immediately when the need arises.

Microprocessors Building Blocks

Microprocessors Building Blocks

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.

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.


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.

Control Unit

That was the structure, now let’s talk about the language of a microprocessor

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
An instruction set, or instruction set architecture (ISA), is a specification detailing the commands that a computer's CPU should be able to understand and execute, or the set of all commands implemented by a particular CPU design. The term describes the aspects of a computer or microprocessor typically visible to a programmer, including the native datatypes, instructions, registers, memory architecture, interrupt and fault system, and external I/O (if any). "Instruction set architecture" is sometimes used to distinguish this set of characteristics from the Micro-Architecture, which are the elements and techniques used to implement the ISA, e.g. microcode, pipelining, cache systems, etc.
Bigger instruction-sets mean more complex chips (higher costs, reduced efficiency), but shorter programs. Each microprocessor family has its unique instruction set. Following are the few ISA;
Motorola 6800
x86 (Pentium)
ALGOL Object Code

The 1st microprocessor : Intel 4004

The first microprocessor was the Intel 4004, introduced in 1971. The 4004 was not very powerful all it could do was add and subtract, and it could only do that 4 bits at a time. But it was amazing that everything was on one chip. Prior to the 4004, engineers built computers either from collections of chips or from discrete components (transistors wired one at a time). The 4004 powered one of the first portable electronic calculators. It was as powerful as ENIAC which had 18000 tubes and occupied a large room. It cost less then $100. Its targeted use was of calculation. It consisted of 2250 transistors and 16pins. Speed was 108 kHz, 60,000 ops/sec.

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. Then 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 Intel came with – Intel Pentium 4 (2.2GHz).
It was introduced in December 2001. It got 55 million transistors. 32-bit word size.
Within the processor it has 2 ALU’s each working at 4.4GHz. It costs around $600.

Moore’s Law

Moore's law(1965) is an empirical observation stating in effect that at our rate of technological development and advances in the semiconductor industry the complexity of integrated circuits doubles every 18 months. His original empirical observation was that the number of components on semiconductor chips with lowest per-component cost doubles roughly every 12 months, and he conjectured that the trend will stay for at least 10 years. In 1975, Moore revised his estimate for the expected doubling time, arguing that it was slowing down to about two years

Evolution of Intel Microprocessors

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 learnt about the function of a microprocessor
And its various sub-systems
Bus interface unit
Data & instruction cache memory
Instruction decoder
Floating-point unit
Control unit