recategorized by
601 views

1 Answer

0 votes
0 votes

Detailed Video Solution: Detailed Video Solution (Click HERE)

Packed BCD (Binary coded decimal) and unpacked BCD are two types of binary codes that represent decimal numbers. Packed BCD uses four bits to represent each decimal digit, while unpacked BCD uses eight bits.

Packed BCD typically encodes two digits within a single byte. For example, 14 is represented as 0001 0100 in packed BCD.

Unpacked BCD usually implies a full byte for each digit. For example, 9 is represented as 0000 1001 in unpacked BCD. 

By Default, BCD means Packed BCD as we use 4-bits for each decimal digit in BCD.

Some computer programs place two BCD digits in one 8-bit byte in packed-BCD representation; thus, one byte may represent the values from 0 to 99 as opposed to 0 to 255 for a normal unsigned 8-bit binary number.

The ONLY difference between Packed BCD & Unpacked BCD is the number of bits that are used to represent a decimal digit. 

$109$ in Packed BCD is $0001 \,\, 0000 \,\, 1001$

$109$ in Unpacked BCD is $00000001 \,\, 00000000 \,\, 00001001$ 


to represent the decimal number $1856357$ in packed BCD (Binary Coded Decimal) form, we need total $28$ bits, i.e. $4$ bytes. 

NOTE that, with $3$ bytes, we can’t represent $28$ bits, But with $4$ bytes we can represent $28$ bits with 4 bits of unnecessary padding.

$1856357$ in packed BCD (Binary Coded Decimal) form is $0001 \,\, 1000 \,\, 0101 \,\, 0110 \,\, 0011 \,\, 0101 \,\, 0111.$

edited by
Answer: