Binary coded decimal

From HomoExcelsior

Jump to: navigation, search

(BCD) 1. A code in which a string of four binary digits (bits) represents a decimal number. A byte can be used to represent 00-99 decimal

Since 4 bits can represent 0-15 dec, the numbers 10-15 are unused. The number 1234 would be 0001 0010 0011 0100. Early 8 bit processors (such as the Z80 CPUs) had instructions for dealing directly with numbers in BCD. For example, incrementing 9 (0000 1001) would result in 10 (0001 0000).




User groups