Common Bus System & Data movement among Registers and Memory

Any Computer system consists of a number of registers, Memory and a control unit. Data and instructions must move from registers to memory and vice-versa. It is difficult to connect the input and output of the registers and memory by individual paths or wires, because it will create a big mesh of wires. So instead of using individual wires a BUS is used. Bus is a more efficient way of transferring data from register to memory and vice-versa. Definition: BUS is a collection of wires which acts as a common pathway through which Data, Instructions and Control Information travels from one component of the computer to another.
In this figure a bus is shown which is used to transfer data from CPU to a floppy and vice versa. This is also called a tape cable because of its tape shape. A number of parallel wires are used to carry the same number of bits at the same time.

A bus is used to transfer data bits in parallel from one component to another. E.g. a 16 bit bus will have 16 wires which can transfer 16 bits at the same time from one component to another. Buses are often classified depending on how many bits they can move at the same time, e.g. we can have 8-bit, 16-bit or 32-bit buses. Various functions of the bus are as follows: 1. Data Sharing – Bus transfers data in parallel from registers to memory, from memory to registers and between computer and peripheral devices. 2. Addressing – A bus can be used to address specific memory locations. So a 16 bit bus can directly address 216 (65536) different memory locations. 3. Sharing Control Information – A bus is often used to carry control signals between CPU and other devices connected to it. 4. Timing - A bus can be used to provide clock signal to the peripheral devices attached to a system. This will help to synchronise peripherals with the rest of the system. 5. Power - A bus can be used to provide power to various peripheral devices attached to a system.

Types of Buses
Based on the above functions there are normally three types of bus in any computer system: An address bus: this determines the location in memory that the processor will read data from or write data to. A data bus: this contains the contents that have been read from the memory location or are to be written into the memory location. A control bus: this manages the information flow between components indicating whether the operation is a read or a write and ensuring that the operation happens at the right time.

This figure depicts 3 different buses. Control Bus carries control signals, Address Bus carries the address of a memory location and the Data bus carries operands and instructions. The Control and Data bus are bidirectional where as the Address bus is unidirectional.

Address Bus: An address bus is used to identify a particular memory location. The location
activated by the address bus will be written to or read from.  Whenever CPU wants to read from or write to a memory location, it specifies the address of that location on the address bus.  Number of wires in the address bus determines how many different memory locations (addresses) can be addressed by the bus.  An address bus with 20 wires can address 220 different memory locations. So a 1 MB RAM needs an address bus with 20 wires. Many modern PCs have Address Bus with 36 address lines to address up to 64 GB of RAM.  The number of wires in the address bus sets an upper limit to the maximum amount of RAM which the CPU can address.  The function of the address bus in the CPU is to tell the address of the operand or instruction to be fetched or to be stored.  Address bus is usually unidirectional because only memory locations are specified by this bus.

Data Bus: A Data Bus is used to transport Data (either operand or instruction) from one
location to another. E.g. from a register to a memory location specified by address bus.  This is a bidirectional bus which transfers data from one component on motherboard to another.  Data Bus contains the contents that have been read from the memory location or are to be written into the memory location.  Data travelling on a data bus can be either an operand on which some operation is to be performed or it can be an instruction which needs to be executed by CPU.  Width of a data bus is the number of wires in the bus. This determines the number of bits that can be carried in parallel. Modern computers have 32 bit or 64 bit data buses. This mean that a 32 bit data bus can carry 32 bit long data in one go.  Data bus can be internal or external. External data bus carries data between a computer and an external device e.g. a mobile. Internal Data bus (also called local bus) carries data between internal components of a computer e.g. between two registers.  Data bus can be Parallel or Serial. Parallel Data Bus carries a number of data bits at the same time, e.g. ATA (Advanced Technology Attachment) and SCSI (Small Computer System Interface). Whereas a serial data bus carries data bits one after the other e.g. USB (Universal Serial Bus).

Control Bus: Every CPU controls various components of the computer by sending them
control signals. Control signals are carried from CPU to other components by a Control Bus.  Control Bus carry control information between the CPU and other devices within the computer.  Control bus is bidirectional. It carries control signals from CPU to other devices and status of the devices from the devices to the CPU.  Read and write operation is possible only if the CPU send a read or write signal to the memory. This is done with the help of control bus.  Interrupt signals are carried through control bus.  Control bus delivers the system clock pulse to various devices to keep them synchronized.  A CPU monitors the actions of other devices with the help of a control bus.

16-Bit Common bus system
Bus is a system of transferring information from one component of a computer to another. In older computers, the Common Bus (local bus) was the only bus that was used in the computer. It was used for the CPU, RAM and I/O (input/output) components. All components on the local bus used the same clock speed. Data and instructions were transferred using this bus. In order to transfer data from one register to another the output of the source register need to be connected to the input of the destination. In a simple computer with only 8 registers and a memory unit if all the outputs were to be connected to all the inputs the total number of wires will be too many to handle. Imagine the scenario with more number of registers. In order to avoid this, a single common bus was used. The following figure shows a 16-Bit common bus system. This figure shows eight registers, one memory unit, one 16-bit common bus and a logic unit.

Selection Control Variables: In the figure of all the eight registers output of only seven
registers is connected to the common bus. The particular register whose output value is to be

transferred by the common bus is selected by the binary value of three Selection Variables (S0, S1 & S2). This is shown as decimal value along each output in the figure. E.g. if value of S0, S1 & S2 is 011 then the value stored in the Data register (DR) is transferred to the 16-Bit common bus. Decimal equivalent of 011 is 3 which is shown against the DR in the figure.

In the figure 16-Bit Common Bus System, provides a common path through which Data and Instructions are transferred between various registers and memory unit and vice versa. DR, AC, IR & TR are 16-Bit registers. AR & PC are 12-Bit registers. OUTR & INPR are 8-Bit registers. The Memory Unit has 4096 words & each word is of 16 Bits.

Memory Data Transfer: The memory in our example is made of 4096 words each of 16
bits. When the Write (WR) input of memory is enabled, the contents of the Common Bus are written to that word of the memory whose address is there in the address input of the memory.

The memory places one of its 16 bit contents on the bus when Read (RD) input is enabled and the value of S0, S1 & S2 is 111. The 16 bit content of that memory word is put on to the bus whose address is in the address input.

12 Bit Registers (AR & PC): There are two 12-Bit Registers AR and PC. Both Address
Register & Program Counter store the address of a memory word. 4096 words can be addressed by 12 bits. So both these registers have 12 bits. When the value of S0S1S2 is 001 then the contents of AR are put on the Bus and if it is 002 then that of PC are put on the bus. The Bus is of 16 bits, so when the 12 bits of these registers is transferred to the bus the 4 most significant bits are set to 0. When the Load (LD) of any of these registers is enabled then the contents of bus are transferred to that register. *The use of dedicated Address Register eliminates the need of separate address bus. The contents of AR specify the address of memory word which is written to or read from during write or read operations to memory.

16 Bit Registers (DR, IR & TR): These registers store 16 bit values which are transferred
to the bus. The contents of these three registers are placed on the bus when the value of S0S1S2 specifies that particular register, which is 3, 5 & 6 respectively. When the load (LD) of any of these registers is enabled then the contents of the bus are transferred to that register.

Accumulator (AC): When the value of S0S1S2 is 100 (decimal 4) then the contents of AC
are transferred to bus so that it can be transferred to some other component of the computer. Accumulator never receives input directly from the Bus. The 16 bit input of the AC come from the Adder and Logic circuits of the ALU. This circuit receives three inputs, which come from: 1. AC : This is for implementing micro-operations like SHIFT AC or ~AC. 2. DR : This implements micro-operations like ADD DR to AC, the result of this operation is stored in AC and if there is any carry it is stored in E flip-flop (Extended AC Bit). 3. INPR : This is used to transfer any input from the input device to the AC.

OUTR & INPR: The Output and Input registers are both 8 Bit registers.
The INPR register is used to transfer the input from an input device to the accumulator. This register does not receive any input from the Bus. The only output this register gives is the one which it gives to the AC. The OUTR receives its input from the Bus when its LD is enabled. This register gives no output to the Bus as it gives output to an output device.

LD, INR, CLR & Clock: LD (Load) input determines which register will receive the
contents of the bus. Only the INPR does not have a LD because input to this register comes from input device and not from Bus. INR is the increment input, whenever INR signal is given to a register its contents are increment by 1. INPR, OUTR & IR have no increment input as it will serve no useful purpose. CLR input clears the contents of the register. INPR, OUTR & IR do not have this input. Except INPR, every register is synchronised with the help of a clock pulse coming from a system clock.