CPU Organization

Discuss the characteristics of system buses.

  • A system bus is the link that connects every segment of a system to the central storage and carries out the data transfer in them.
  • It is a pathway composed of cables and connectors which is used to carry data between a computer microprocessor and the main memory.
  • It provides a communication path for the data and control signals moving between the major components of the computer system.
The types of a system buses are

1. Data
  • These are the pieces of information that are to be transferred.
  • The data is transferred between peripherals, memory and the CPU. The data bus can be a very busy pathway.
2. Address
  • It stores the information about where the data is to be transferred.
  • The components pass memory addresses to one another over the address bus.
3. Control
  • These are the set of instructions regarding what to do with the data.
  • It is used to send out signals to coordinate and manage the activities of the motherboard components.
Characteristics of a System Bus

1. Bus Width
  • The size of a bus also known as its width.
  • It determines how much data can be transferred at a time.
  • This refers to the amount of information that can be transferred once.
2. Bus Speed
  • This refers to the no. of bits or bytes the bus can send per unit time.
  • It is also defined by its frequency. Frequency means that the number of data packets sent or received per second. Each time that data is sent or received is called a cycle.
System Bus Architecture

System bus architecture
  • The system bus combines the functions of the three main buses, namely Control Bus, Address Bus, Data Bus.
  • The control bus carries the control, timing and coordination signals to manage the various functions across the system.
  • The address bus is used to specify memory locations for the data being transferred.
  • The data bus, which is a bidirectional path. It carries the actual data between the processor (CPU), the memory and the peripherals (Input and Output).
  • The system bus architecture varies from system to system and can be specific to a particular computer design.
  • The other common characteristics of system buses are based on the primary role, connecting devices internally or externally etc.
Internal Bus
  • It is also known as internal data bus, memory bus, system bus or Front-Side-Bus.
  • It connects all the internal components of a computer, such as CPU and memory, to the motherboard.
  • Internal data buses are also referred to as a local bus, because they are intended to connect to a local devices.
  • This bus is quick and independent of the rest of the computer operations.
External Bus
  • It is also known as expansion bus.
  • It is made up of the electronic pathways that connect the different external devices, such as printer etc.

What are different types of interrupts? Draw a state diagram of instruction execution cycle with interrupts.

An interrupt is a signal to the system indicating the occurrence of an event which needs to be figured out for further execution.

In case of an interrupt:
  • System either stop executing the current program and switch to another.
  • Or it keeps executing it anyway.
The types of interrupts are:

1. Hardware Interrupts: When the signals are generated by the hardware devices those are hardware interrupts.
For example: power failure.

These can be further classified as follows.
  • I. Maskable Interrupt: The interrupts which can be kept on hold in case a higher priority interrupt occurs.
  • II. Non-maskable Interrupt: The interrupts which cannot be kept on hold.
2. Software Interrupts: When the interrupts occur while execution, they are caused internally.

These can also get further divided as:
  • I. Normal interrupts: These are caused by the software instructions.
  • II. Exceptions: During the program execution an unplanned interrupt that occurs is termed as an exception.
Instruction Execution Cycle

Instruction Execution Cycle
  • This is a process of getting the instruction from the memory, decoding it to the machine language and executing it. So, three basic steps of the cycle are:
  • Fetch the instruction.
    Decode it.
    Execute.
  • The whole process of fetching the instructions from the memory, decoding it to the machine language and executing it, is termed as a instruction cycle.
These are the steps involved in each instruction cycle. They are:

Step1: Fetch
  • In this step the instructions are fetched from the memory and are put into the instruction register.
  • The instructions are decoded to the machine language.
  • Gets the accurate address from the memory in case it is not correct.
Step2: Execute
  • It simply executes the instructions.

Compare Hardwired and Microprogram control Unit.

Hardwired Control Unit

Hardwired control unit
Microprogram Control Unit

microprogram control unit
The comparison between a Hardwired control unit and a Microprogram control unit is given in the table below:

Sr. No.Hardwired Control UnitMicroprogram Control Unit
1.Its a hardware control unit.It lies between the software and the hardware.
2.It has a high error rate.Error rate is comparatively low.
3.It is difficult to design, test and implementation.It is easy to design, test and implementation.
4.Modifications are not flexible.Modifications are flexible.
5.It uses a finite state machine to generate signals.It generates signals using a control line.
6.Example: RISC processor.Example: CISC processor.
7.It uses flags, decoder, logic gates and other digital circuits.It uses sequence of micro programming language.
8.On the basis of input signal output is generated.It generates a set of control signal on the basis of control line.
9.It has faster mode of operation.It has slower mode of operation.
10.It is expensive.It is cheaper.

What is pipelining? Discuss the hazards and overcoming techniques in pipelining.

  • Pipelining is a technique in which multiple instructions are overlapped in execution.
  • It is an implementation technique.
  • System pipeline is divided in stages.
  • Each stage carries out a part of an instruction.
  • The stages are connected to one another in the form of a pipe.
  • Instructions enter through one end, progress, and exit through the other end.
  • It does not decrease the time for individual instruction execution. Instead, it increases the instruction throughput.
Example
The best example would be a manufacturing industry, like a product is divided into different components and is sent to different production units and at the end it is combined to get the final product. Similarly, the instructions enter the pipeline,gets executed and comes out of the other end.

Pipelining Hazards and Overcoming Techniques
  • The fact that the instructions in a pipeline are dependent on each other, many obstacles are faced in it.
Types of Pipeline Hazards

There are three types of pipeline HAZARDS:

1. Structural Hazards
  • It occurs when two instructions demand the same hardware resource at the same time.
  • It can be reduces by having redundant hardware for the segments wherein the collision occurs.
2. Control hazards
  • It occurs when conditional branches interfere with instruction fetches in a pipeline.
  • The location of an instruction depends on previous instruction.
  • It can cause a greater performance loss for DLX pipeline than data hazards.
3. Data hazards
  • It occurs when two instructions in a pipeline refer to the same register and at least one of them writes to the register.
  • An instruction uses the result of the previous instruction. It occurs exactly when an instruction tries to read a register in its ID stage.
  • There are three different types of Data Hazards:
    I. RAW (Read After Write): It occurs when, in the code as written, one instruction reads a location after an earlier instruction writes new data.
    II. WAR (Write After Read): It is the reverse of a RAW. It occurs after a read, but the pipeline causes write to happen first.
    III. WAW (Write After Write): It is a situation in which two writes occur out of order.
Overcoming Techniques
The hazards can be overcome depending upon the order of its preference. The 4 techniques that helps in resolving them are:

1. Stall the pipe
  • This technique blocks the pipe and stops any more instructions to come in it until the hazards resolve themselves.
  • It slows down the system.
2. Add hardware
  • Duplicate the hardware which is demanded.
  • This techniques is widely used by the MIPS pipelines.
3. Forward
  • If the data is present otherwise but is not at the desired location.
  • Create data paths to forward the data to the desired location.
4. Document
  • Provide the instruction that is missing.
  • Change the instruction that accounts for the hazard.
  • Worst solution out of all the four.

Write a short note on RISC.

  • RISC stands for Reduced Instruction Set Computer.
  • It recognizes the smaller and relatively less no. of instructions.
  • They have a high execution speed.
  • Low designing cost as they require very less no. of transistors.
A few design features of RISC are
  • One cycle execution time: RISC processors have a “one cycle” CPI (clock per instruction).
  • Pipelining: Process that allows the parallel execution of instructions.
  • Number of registers: The RISC design uses a large number of registers.
Advantages of RISC
  • If the demand is for less complicated and lesser number of instructions RISC is very useful.
  • For programmers who use the microprocessor's instructions, it gets easier to develop the code.
  • It helps in managing the use of space on a microprocessor.

Explain instruction and execution cycle.

Instruction Cycle:

The whole process of fetching the instructions from the memory, decoding it to the machine language and executing it, is termed as a instruction cycle. These are the steps involved in each instruction cycle.

Step1: Fetch
  • In this step the instructions are fetched from the memory and are put into the instruction register.
  • The instructions are decoded to the machine language.
  • Gets the accurate address from the memory in case it is not correct.
Step2: Execute
  • It simply executes the instructions.
Execution Cycle:

In the execution cycle, the program is executed according to the instructions that are fetched from the memory.

The pre-requisites for a program to get executed are
  • The program must be the part of the computer memory.
  • It must occupy the continuous bytes in the memory in order to avoid hazards.
  • It should be in the machine language.
The number of steps that every instruction cycle is composed of depends on the architecture of the processor. A hardware designer decides on to this.

The basic two parts that every execution cycle will have are

Part1: OP- Code
  • Its a simple binary value that specifies the role of each instruction.
Part2: Address Field
  • It specifies the memory location from where the registers are fetched and where they will be stored.

Compare RISC and CISC architectures.

RISC
  • It handles the small and less complicated instructions.
Diagram

RISC Architecture
CISC
  • It handles the large complex instructions.
Diagram

CISC Architecture
Comparison between RISC and CISC

Sr. No.RISCCISC
1.RISC stands for Reduced Instruction Set Computer.CISC stands for Complex Instruction Set Computer.
2.Handles less complicated and small instructions.Handles complex and large instructions.
3.Low design cost, as less no. of registers are required.High design cost as to handle the complex instructions more no. of registers are required.
4.More cycles per unit time are carried out.Less cycles per unit time are carried out.
5.The decoding process is easy as the instructions are not complex.Complex decoding process as the instructions are complex.
6.Examples: MIPS, PowerPC.Examples: x86 variants.
7.It has faster clock speeds.It has slower clock speeds.
8.It gives simpler instruction set.It gives rich instruction set.

Discuss arithmetic pipelining with a flow diagram.

  • The pipeline structures that are used for instruction pipelining are applied in some processing tasks.
  • If pipelining is useful we may have to perform the large tasks in a sequential form. These large numerical applications usually make use of repeated arithmetic operations for processing the elements. For such applications pipelining architecture is provided to speed up the process. This process is called arithmetic pipelining.
  • Pipelining is a technique in which multiple instructions are overlapped in execution.
  • It is an implementation technique.
  • System pipeline is divided in stages.
  • Each stage carries out a part of an instruction.
  • The stages are connected to one another in the form of a pipe.
  • Instructions enter through one end, progress, and exit through the other end.
  • It does not decrease the time for individual instruction execution. Instead, it increases the instruction throughput.
Features of Arithmetic Pipelining
  • Each stage executes in fixed number of cycles which makes it synchronous.
  • It has eight different sections, one for each kind of arithmetic operation.
  • Every stage is readily available to accept the data coming from its previous stage without any delays.
  • Each stage can be connected to any other stage to form a correct sequence for execution.

Write a short note on Microprogrammed Control Memory.

What is Microprogrammed Control Memory?
  • Microprogrammed control unit is the approach by which the control signals required inside the CPU can be generated.
  • The microprogram is analogous to a computer program. Like in a computer program, the instructions of the program are stored in memory and during execution they are fetched from memory one by one and program counter manages the sequence of instructions.
  • Similarly, microprogram is stored in microprogram memory and the execution is controlled by microprogram counter.
  • Microprogram consists of instructions in the strings of 0's and 1's and these are called the microinstructions. These are the instructions that handle the microprograms.
Features of Microprogrammed Control Memory
  • It lies between the software and the hardware.
  • It is stored in a control memory.
  • Error rate is comparatively low.
  • It is easy to design, test and implementation.
  • Modifications are flexible.
  • It generates signals using a control line.
  • It uses sequence of micro programming language.
  • It generates a set of control signal on the basis of control line.
  • It has slower mode of operation. It is cheaper.
Diagram

Multiprogrammed Control Memory