Wednesday, September 10, 2014



vMultiple- Precision Binary NumbersúSingle – precision  --   one- byte unsigned          numbers ( range: 0-255)úDouble – precision --   two- byte unsigned           numbers (range: 0-65 535)úTriple – precision –  three- byte unsigned             numbers (range: 0-16 777 215)





vZero Flag
    - shows that the last operation produced a result of 0. Unusual feature of the zero flag:
  - Contains a 1 when result is 0 and the flag is 0 when the result is anything other  than 0.
    - 0 says that something is false or has not occurred. 0 says, “No, this number was not the number zero”.

  - 1 says that something is true or has occurred. 1 says, “Yes, the number is the number zero”.
vSubtraction-with-Carry (Borrow)
  - tells us that to produce the answer (difference) the microprocessor had to borrow a 1 from a 9th bit. This occurs when the top number (minuend) is smaller than the bottom number (subtrahend).
v Multiplication and Division

  - there are several software algorithms for both multiplication and division which work well with the 8 bit microprocessors.

Tuesday, September 9, 2014

Arithmetic Instructions

vAddition
  - when adding binary numbers, the microprocessor produces two types of information:
  1. the sum of the two numbers (answer);
  2. information indicating whether there were carries in certain columns.



vCarry Flag
  - during addition, the 8- bit sum is not the complete answer. If the carry flag is set (has a value of 1), it indicates that the 9th bit was produced.
  -the 1 in the carry flag would indicate a carry from column 8 to column 9.
  - we cannot see a 9th bit since the accumulator only holds 8 bit.
vHalf-Carry Flag

  - indicates that a carry has occurred from the 4th- bit column to the 5th-bit column.
vOverflow Flag
  - alerts the programmer to a condition that is similar to, but not the same as, that to which a carry flag alerts the programmer.
vAddition with Carry
  - the carry from the 8th bit to the 9th bit can be used during multiple- precision arithmetic. We use the multiple- precision arithmetic when the accumulator cannot accept numbers large enough for the desired operation.

Monday, September 8, 2014

ARITHMETIC AND FLAGS

Microprocessors and Numbers

  • Binary and Hexadecimal Numbers
  • Binary- Coded Decimal Numbers     
  • ASCII 
  • Microprocessors and Number Conversation 
  • Bit Positions


 

Flag Instructions

  • - each of our microprocessors has instructions to alter the state of its flags. Which of their flags and how many of their flags can be directly altered vary.

  • we use the flags primarily during arithmetic operation and for control of loops, branches and subroutines. 

  • since flags are used to give us information about the outcome of arithmetic operations, we often need the set or clear flags before these math operations.