Difference between revisions of "Binary-coded decimal"
From Computer History Wiki
(A start) |
m (+cat) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''Binary-coded decimal''' (usually written as '''BCD''') is a way of storing arbitrary-length numbers in decimal base on a binary computer. Each decimal digit is stored as four [[bit]]s, usually two per [[byte]] ('packed'), although sometimes only one per byte ('un-packed'). 4-bit values not needed to encode a decimal digit are often used for other symbols, e.g. '-', to indicate a negative number. | '''Binary-coded decimal''' (usually written as '''BCD''') is a way of storing arbitrary-length numbers in decimal base on a binary computer. Each decimal digit is stored as four [[bit]]s, usually two per [[byte]] ('packed'), although sometimes only one per byte ('un-packed'). 4-bit values not needed to encode a decimal digit are often used for other symbols, e.g. '-', to indicate a negative number. | ||
− | {{stub}} | + | On some machines, BCD was supported in the [[hardware]], as a formal data type with [[instruction]]s which could operate on BCD data (sometimes by an optional [[Commercial Instruction Set]]); on other machines, it was done in [[software]], via [[subroutine package]]s. |
+ | <!-- (although some [[architecture]]s, such as the [[Intel x86]], do include some [[instruction]]s to help). --> | ||
+ | |||
+ | {{semi-stub}} | ||
+ | |||
+ | [[Category: Computer Basics]] |
Latest revision as of 17:30, 16 December 2018
Binary-coded decimal (usually written as BCD) is a way of storing arbitrary-length numbers in decimal base on a binary computer. Each decimal digit is stored as four bits, usually two per byte ('packed'), although sometimes only one per byte ('un-packed'). 4-bit values not needed to encode a decimal digit are often used for other symbols, e.g. '-', to indicate a negative number.
On some machines, BCD was supported in the hardware, as a formal data type with instructions which could operate on BCD data (sometimes by an optional Commercial Instruction Set); on other machines, it was done in software, via subroutine packages.