Skip to main content

ALU and Data Path


Amu_Ke_Fundye


ALU and Data Path


The CPU can be divided into a data section and a control section. The data section, which is also called the datapath.



Datapath

The registers, the ALU, and the interconnecting bus are collectively referred to as the datapath. Each bit in datapath is functionally identical. The datapath is capable of performing certain operations on data items.

The control section is basically the control unitwhich issues control signals to the datapath.

Bus: A Bus is a collection of wires or distinct lines meant to carry data, address and control information.

Data Bus: it is used for transmission of data. The number of data lines corresponds to the number of bits in a word.

Address Bus: it carries the address of the main memory location from where the data can be accessed.

Control Bus: it is used to indicate the direction of data transfer and to coordinate the timing of events during the transfer.

PC (Program Counter): Holds the address of the next instruction

IR (Instruction Register): Holds the executing instruction

Instruction Cache: ‘Fast’ memory where the next instruction comes from Reg[index]

(Register File): Contains the 32 registers

Arithmetic Logic Unit (ALU): Performs all arithmetic operations

Data Cache: Data read from or written to ‘fast’ memory

Multiplexer: Multiple inputs selects one output based upon control signal(s)

Single-Cycle Data Path: Each instruction executes in one clock cycle

Multi-Cycle Data Path: Each instruction takes multiple clock cycles

Single-Cycle Data Path

  • Every cycle must be equal length
  • The cycle time must be long enough to accommodate the longest instruction.

Multi-Cycle Data Path

  • Have the cycle time coincide with the instruction stage time.
  • Cycle time = 2 ns (time of longest stage)
  • Between stages we need registers to hold data for next stage.
image001
  • Accumulator: Special register
    • One of the inputs to ALU
    • Output of ALU stored back in accumulator
  • One-Address Instructions: Operation and address of one operand
    • Other operand and destination is accumulator register
    • AC <– AC op Mem[addr]
    • Single address instructions (AC implicit operand)
  • Multiple Registers: Part of instruction used to choose register operands
image002

Instruction Path

  • Program Counter
    • Keeps track of program execution
    • Address of next instruction to read from memory
    • May have auto-increment feature or use ALU
  • Instruction Register
    • Current instruction
    • Includes ALU operation and address of operand
    • Also holds target of jump instruction
    • Immediate operands
  • Relationship to Data Path
    • PC may be incremented through ALU
    • Contents of IR may also be required as input to ALU

Memory Interface



Memory
  • Separate data and instruction memory: Two address busses, two data busses
  • Single combined memory: Single address bus, single data bus

Separate Memory
  • ALU output goes to data memory input
  • Register input from data memory output
  • Data memory address from instruction register
  • Instruction register from instruction memory output
  • Instruction memory address from program counter

Single Memory
  • Address from PC or IR
  • Memory output to instruction and data registers
  • Memory input from ALU output

One-Bus Organization
  • CPU registers and the ALU use a single bus to move outgoing and incoming data.
  • Bus can handle only a single data movement within one clock cycle.
  • This bus organization is the simplest and least expensive.
  • It limits the amount of data transfer that can be done in the same clock cycle, which will slow down the overall performance.
image003
Two-Bus Organization
  • General-purpose registers are connected to both buses.
  • Data can be transferred from two different registers to the input point of the ALU at the same time.
  • Two operand operation can fetch both operands in the same clock cycle.
image004
Three-Bus Organization
  • Two buses may be used as source buses while the third is used as destination.
  • The source buses move data out of registers (out-bus), and the destination bus may move data into a register (in-bus).
  • Each of the two out-buses is connected to an ALU input point. The output of the ALU is connected directly to the in-bus
  • Increasing the number of buses will also increase the complexity of the hardware.
image005
Instruction Cycle
  • The sequence of operations performed by the CPU during its execution of instructions.
  • At the completion of the instruction execution, a test is made to determine whether an interrupt has occurred.
  • An interrupt handling routine needs to be invoked in case of an interrupt.

The basic actions during fetching an instruction, executing an instruction, or handling an interrupt are defined by a sequence of micro-operations.

A group of control signals must be enabled in a prescribed sequence to trigger the execution of a microoperation.

Condition Codes: The processor keeps track of some information about the results of various operations for use by subsequent conditional branch instructions, by recording the required information into individual bits called as condition code flags. Some processors may collect this information in Status register or condition code register.

Important flags of status/condition code register:
  • N (negative) Sets to 1 if the result is negative; otherwise, cleared to 0
  • Z (zero) Sets to 1 if the result is 0; otherwise, cleared to 0
  • V (overflow) Sets to 1 if arithmetic overflow occurs; otherwise, cleared to 0
  • C (carry) Sets to 1 if carry-out results from the operation; otherwise, cleared to 0
Regards 
Amrut Jagdish Gupta

Comments

Popular posts from this blog

Undecidability

Amu_Ke_Fundye Undecidability Decidable Problem If there is a Turing machine that decides the problem, called as Decidable problem. A decision problem that can be solved by an algorithm that halts on all inputs in a finite number of steps. A problem is decidable, if there is an algorithm that can answer either yes or no. A language for which membership can be decided by an algorithm that halts on all inputs in a finite number of steps. Decidable problem is also called as totally decidable problem, algorithmically solvable, recursively solvable. Undecidable Problem A problem that cannot be solved for all cases by any algorithm whatsoever. Equivalent Language cannot be recognized by a Turing machine that halts for all inputs. The following problems are undecidable problems: Halting Problem:  A halting problem is undecidable problem. There is no general method or algorithm which can solve the halting problem for all possible inputs. Emptyness Problem:  Wh

Sequential Logic Circuits

Amu_Ke_Fundye Sequential Logic Circuits In sequential logic circuit, the output is dependent upon the present inputs as well as the past inputs and outputs. Sequential circuit is of two types. Synchronous Sequential Circuit:  Change in input signals can affect memory elements only upon activation of clock signals. Asynchronous Sequential Circuit:  Change in input signals can affect memory elements at any instant of time. These are faster than synchronous circuit. Flip Flops: It is a one-bit memory cell which stores the 1-bit logical data (logic 0 or logic 1). It is a basic memory element. The most commonly used application of flip flops is in the implementation of a feedback circuit. As a memory relies on the feedback concept, flip flops can be used to design it. In synchronous sequential circuit, Memory elements are clocked flip flops and generally edge triggered. In asynchronous sequential circuit, Memory elements are unclocked flip flops / time delay