Wolmer’s Trust High School for Girls

CAPE COMPUTER SCIENCE

 

Upper and Lower Six                                          Teacher:  Mrs. McCallum-Rodney

 

REGISTERS

 

In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere. Most, but not all, modern computer architectures operate on the principle of moving data from main memory into registers, operating on them, then moving the result back into main memory—a so-called load-store architecture. A common property of computer programs is locality of reference: the same values are often accessed repeatedly; and holding these frequently used values in registers improves program execution performance.

Processor registers are at the top of the memory hierarchy, and provide the fastest way for a CPU to access data.  Allocating frequently used variables to registers can be critical to a program's performance. This action, namely register allocation is performed by a compiler in the code generation phase.

Registers play an important role in computers. Some of them are visible to the programmer, and are used to hold variable values for later use. Some of them are hidden to the programmer, and are used to hold values that are internal to the central processing unit, but nevertheless important.

Register                 - A sequential circuit capable of storing a set of bits at a give time

register word size - the maximum number of bits stored at any given time in a                     register (4-bit register, 8-bit register, 32-bit register, and so on).

CATEGORIES OF REGISTERS

Registers are normally measured by the number of bits they can hold, for example, an "8-bit register" or a "32-bit register". Registers are now usually implemented as a register file, but they have also been implemented using individual flip-flops, high speed core memory, thin film memory, and other ways in various machines.

A processor often contains several kinds of registers, that can be classified according to their content or instructions that operate on them:

  • User-accessible Registers - The most common division of user-accessible registers is into data registers and address registers.
  • Data registers are used to hold numeric values such as integer and floating-point values. In some older and low end CPUs, a special data register, known as the accumulator, is used implicitly for many operations.
  • Address registers hold addresses and are used by instructions that indirectly access memory.
    • Some processors contain registers that may only be used to hold an address or only to hold numeric values (in some cases used as an index register whose value is added as an offset from some address); others allow registers hold either kind of quantity. A wide variety of possible addressing modes, used to specify the effective address of an operand, exist.
    • A stack pointer, sometimes called a stack register, is the name given to a register that can be used by some instructions to maintain a stack (data structure).
  • Conditional registers hold truth values often used to determine whether some instruction should or should not be executed.
  • General purpose registers (GPRs) can store both data and addresses, i.e., they are combined Data/Address registers.
  • Floating point registers (FPRs) store floating point numbers in many architectures.

 

4-bit register using D flip-flops

CP

load

Function (D flip-flop)

0

0

maintain

0

1

maintain

1

0

maintain

1

1

read input I

 

This is a register built using 4 D-type flip-flops, able to store 4 bits of data at a time.

The input word I is connected to the inputs of the four flip-flops, with the least significant bit I1 placed in R1, I2 in R2, and so on.

 

Note that D-type flip-flops will only read input whenever the clock pulse input is high. The clock pulse, CP is ANDed with a load signal, which means that the flip-flop will only accept data when both CP and load are 1.

 

When load is set to 0, the clock pulse input of the D flip-flops will always be zero, regardless of the value of CP. The register will retain its current data until load is set to 1, indicating that the register should then read input from I during the next clock pulse.

 

The contents of the register will only be output to lines O1 to O4 during the next clock pulse. Therefore, any data we store into the register can only be read from the register in the next clock pulse, and not in the current one. Unlike input, we can read data at any time, regardless of the setting of the load signal.

 


 


 

 

 

 

Make a Free Website with Yola.