Student Notes Theory Page 1 K Aquilina Further reading: JW pg 276 C Comp put ter L Lo g g i ic 2 What is a Register?In a previous topic we have seen that a register is a, special, high-speed storage area within the CPU. All data must be represented in a register before it can be processed. For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is also placed in a register. (The register can contain the address of a memory location where data is stored rather than the actual data itself.) A REGISTER is a storage location with a fixed number of bits. Hence, in an 8-bit register, the number 1 will be stored as: 00000001 Numerical OverflowNUMERIC OVERFLOW occurs when the result of a computation (calculation) is outside a fixed range, such as that of a register. Example: In order to store a 9-bit number (101010000) in an 8-bit register, two 8-bit registers have to be taken up (i.e. it would overflow if put in one 8-bit register: Two 8-bit registers 00000001 01010000 Left ShiftShifting a binary number left by 1 bit multiplies it by 2. Shifting a binary number left by 1 bit means inserting a 0 to the right, so that this becomes the new least significant bit: 101100 2 = 44 10 1011000 2 = 88 10 Right ShiftShifting a binary number right by 1 bit halves it. Shifting a binary number right by 1 bit means deleting the present least significant bit, irrespective of whether this is a 1 or a 0, so that the bit next to it, (on the left), becomes the new significant bit: 100111 2 = 39 10 10011 2 = 19 10 NOTE THAT WHEN SHIFTING A BINARY NUMBER TO THE RIGHT, AND A 1 IS DELETED, SINCE THAT WAY DATA IS LOST, THE VALUE MAY NOT BE EXACTLY HALVED.