Thursday, 21 November 2013

Instructions

A program instruction is made of 2 parts, the operator or instruction and operand or memory location it should use. For example, a Byte could be split into sets of 4bites, first the operator and second the operand. 
In this example, for first 4bites: 1001 tells the CPU to Add data to the accumulator, 1010 tells it to store data from accumulator into memory location, 1011 tells it to subtract data in location from accumulator.
The second 4bites (memory location): 1100 has 7 in it, 1101 has 4 in it.
So: 1001 0011, 1011 1101, 1010 1110 says: add (0011) 3 too accumulator (total is now 3) then subtract (location 1101) 4 from accumulator (3-4) (-1) then store that data in location 1110.

No comments:

Post a Comment