AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Abcd format7/27/2023 Packed BCD has been in use since at least the 1960s and is implemented in all IBM mainframe hardware since then. In packed BCD (or simply packed decimal ), each nibble represent a decimal digit. Other bitwise operations are used to convert a numeral to its equivalent bit pattern or reverse the process. Shifting and masking operations are used to pack or unpack a packed BCD digit. Packed BCD is more efficient in storage usage than unpacked BCD encoding the same number (with the leading zero) in unpacked format would consume twice the storage. Here, the most significant nibble of the most significant byte has been encoded as zero, so the number is stored as 012345 (but formatting routines might replace or remove leading zeros). For example, to represent the decimal number 12345 in packed BCD, using big-endian format, a program would encode as follows: To represent numbers larger than the range of a single byte any number of contiguous bytes may be used. Hence the numerical range for one unpacked BCD byte is zero through nine inclusive, whereas the range for one packed BCD byte is zero through ninety-nine inclusive. In packed BCD, the same number would fit into a single byte: Īs an example, encoding the decimal number 91 using unpacked BCD results in the following binary pattern of two bytes:
0 Comments
Read More
Leave a Reply. |