Fact-checked by Grok 2 weeks ago

Binary-coded decimal

Binary-coded decimal (BCD) is a of encoding decimal numbers in , where each individual from 0 to 9 is represented by a fixed group of four bits corresponding to its pure . Developed in the early era of to reconcile the nature of with the familiar to humans, BCD emerged as a representation that preserves structure while using for storage and processing. This approach was particularly prevalent in mid-20th-century mainframe s, where it facilitated direct arithmetic without the need for complex conversions that could introduce errors in -only representations. Key variants include packed BCD, which stores two per byte for efficiency, and zoned BCD, often used in character encodings like for compatibility with text processing. One primary advantage of BCD is its simplicity in converting between and formats, making it ideal for applications requiring human-readable outputs, such as displays and calculators, where each digit can be directly mapped without algorithmic transformation. Additionally, BCD avoids the discrepancies common in pure floating-point operations, ensuring exact representation of fractions in fields like and scientific computation. However, BCD is less storage-efficient than pure , as it utilizes only 10 of the 16 possible 4-bit combinations per digit, leading to up to 20% more space for the same numerical range and potentially slower processing due to specialized or software handling. Despite these drawbacks, BCD persists in modern systems, clocks, programmable logic controllers (PLCs), and legacy-compatible environments where decimal precision outweighs efficiency concerns.

Fundamentals

Definition and Principles

Binary-coded decimal (BCD) is a method of encoding numbers in by representing each individual with a fixed group of bits, typically four bits to accommodate the digits 0 through 9. This approach allows computers and digital systems to store and process data directly in a form that mirrors the structure, eliminating the need for repeated binary-to-decimal conversions during arithmetic operations. In the standard BCD scheme, known as the 8421 weighted code, each decimal digit is encoded using four binary bits where the weights correspond to powers of 2 (8, 4, 2, 1). The encodings are as follows: 0000 for 0, 0001 for 1, 0010 for 2, 0011 for 3, 0100 for 4, 0101 for 5, 0110 for 6, 0111 for 7, 1000 for 8, and 1001 for 9, with the remaining combinations (1010 through 1111) left unused to ensure unambiguous . This fixed-width encoding preserves the positional significance of each decimal digit, preventing issues like carry propagation from altering higher digits in ways that deviate from decimal arithmetic rules. A key principle of BCD is its ability to maintain exact values without the rounding or approximation errors inherent in representations of non-integer decimals, as each is handled independently and no fractional expansions are required. For instance, the number 29 is encoded in BCD as 0010 1001 (equivalent to 0x29), where the first (0010) represents 2 and the second (1001) represents 9. In terms of storage, BCD is less efficient than pure for the same numerical range; for example, decimal 99 requires 8 bits in BCD (1001 1001) but only 7 bits in (1100011). This trade-off prioritizes decimal fidelity over compactness, making BCD suitable for applications where precise decimal handling is essential.

Historical Background

Binary-coded decimal (BCD) emerged in the context of early computing's need for to align with human intuition and existing equipment. In the , electromechanical machines like the utilized decimal mechanisms, such as wheels with ten positions for digits, to ensure outputs were directly readable and compatible with punch card tabulators, prioritizing usability over the emerging logic in designs. During the 1950s, advanced BCD as a to encode individual decimal digits using bits, facilitating the transition to electronic computers while preserving decimal accuracy for applications. This development was integral to punch card systems and early machines like the (introduced in 1959), which employed 6-bit BCD variants to represent numeric data efficiently in . Standardization accelerated in the 1960s with 's creation of the around 1963–1964, building on prior BCD schemes to incorporate zoned formats for alphanumeric data. The family, announced in 1964, embedded BCD support in its architecture to ensure compatibility with legacy equipment, solidifying its role in commercial . Although BCD waned in general-purpose personal from the onward, supplanted by pure for greater efficiency, it endured in financial and mainframe environments due to its precision in decimal operations, preventing errors in monetary computations within COBOL-based systems that process vast transaction volumes.

Primary Encodings

Packed BCD

Packed -coded (PBCD), also known as packed BCD, encodes numbers by storing two s per 8-bit byte, with the high-order (bits 7–4) representing the tens and the low-order (bits 3–0) representing the units . Each uses a 4-bit value from 0000 (0) to 1001 (9) to directly correspond to the it encodes. This format optimizes compared to unpacked BCD by halving the space for representation, though it requires conversion for character-based . In fixed-point packed decimal, numbers are represented as pure integers without an embedded point, allowing straightforward by powers of 10 for fractional values during computation. Storage allocates full bytes for even-length sequences, while odd-length sequences use the high of the final byte for the last , leaving the low for the . The overall length in bytes is calculated as \lceil (d + 1)/2 \rceil, where d is the number of , for the sign nibble. For example, the 1234 (four ) is stored in the digit portion as 0x12 0x34 (binary 0001 0010 0011 0100), with the appended in an additional low such as 0x0C for positive in a three-byte field. The sign in packed BCD is typically stored in a dedicated low-order of the final byte, separate from the digits, using specific 4-bit patterns outside the 0–9 range. In IBM's format, (hex C) denotes positive, 1101 (hex D) denotes negative, and 1111 (hex F) indicates unsigned or positive-preferred. The hexadecimal values A–F (1010–1111) are generally unused for digit encoding to avoid ambiguity in BCD validity checks, but in the sign position, values like C, D, and F serve as zone or sign indicators, with others reserved for extensions or error detection in some systems.

Zoned BCD

Zoned binary-coded decimal (ZBCD), also known as zoned decimal, represents each decimal digit using an 8-bit byte, where the low-order (4 bits) encodes the digit value from 0 to 9, and the high-order (4 bits) serves as a zone field typically set to a fixed value for compatibility with standards. This format facilitates direct operations with character-based peripherals, as the bytes correspond to printable digit characters in the respective code pages. In the zoned decimal format, prevalent in systems, the zone nibble is uniformly set to 1111 (hexadecimal F) for numeric digits, resulting in byte values from F0 to F9 for digits 0 through 9, respectively. These encodings align with character codes for the digits, enabling seamless integration with text processing. An ASCII variant of zoned decimal employs a zone nibble of 0011 0000 (hexadecimal 30, or 48) for each , producing byte values such as 30 to 39 hexadecimal for s 0 through 9; for instance, the 5 is encoded as 35 hexadecimal (0011 0101 ). This matches the standard ASCII codes for numeric characters, supporting compatibility in systems using 7- or 8-bit ASCII environments. Fixed-point zoned decimal representations store integer numeric strings where each digit occupies a full byte with its , and the is encoded in the high-order of the least significant (rightmost) byte: hexadecimal F indicates positive, while D indicates negative in , overriding the zone for the final . Leading digits retain their standard zones (F in ), ensuring the entire field can be treated as a character string for display or input. Conversion from zoned decimal to packed BCD involves stripping the zone nibbles from each byte to isolate the digit nibbles, then combining pairs of consecutive digit nibbles into single bytes (high-order digit first), with the sign placed in the low-order nibble of the final byte; the result is right-aligned and may require padding if the digit count is odd. The reverse process unpacks bytes into individual digit nibbles, inserts appropriate zone nibbles for each (F in ), and applies the sign to the zone of the last byte. This aligns zoned data, which is I/O-oriented, with the denser packed format used for computation. The following table illustrates EBCDIC zoned decimal encodings for digits 0-9 in unsigned form, along with signed variants in the low-order byte:
Decimal DigitUnsigned Zoned Byte (Hex)Positive Signed (Low-Order, Hex)Negative Signed (Low-Order, Hex)
0F0F0D0
1F1F1D1
2F2F2D2
3F3F3D3
4F4F4D4
5F5F5D5
6F6F6D6
7F7F7D7
8F8F8D8
9F9F9D9

Arithmetic Operations

Addition

Binary-coded (BCD) addition involves processing each digit independently using 4-bit nibbles, ensuring the result remains a valid BCD representation (0-9 per ) by applying a correction when the binary sum exceeds 9. The process begins with of corresponding nibbles from the two operands, followed by detection and adjustment for invalid sums to maintain accuracy without full handling. The detailed steps for adding two BCD digits A and B, including an incoming carry C_in (0 or 1), are as follows: first, compute the temporary sum S_temp = A + B + C_in using addition; then, check if S_temp > 9 or if a carry-out occurred during the addition; if either condition is true, add 6 (binary 0110) to S_temp to produce the corrected S and set the outgoing carry C_out to 1; otherwise, C_out is 0 and S = S_temp. This correction works because adding 6 to a value between 10 and 18 (the possible range for two digits plus carry) adjusts it to the range 16-24, which in triggers a carry-out of 1 while leaving the low 4 bits as the correct decimal (e.g., 10 + 6 = 16, low 0000 with carry 1). The equation for a single can be expressed as: S = (A + B + C_{in}) + 6 \cdot \delta, \quad C_{out} = \left\lfloor \frac{A + B + C_{in} + 6 \cdot \delta}{16} \right\rfloor where \delta = 1 if A + B + C_{in} > 9 or if there was a binary carry-out from the low 4 bits, else \delta = 0. Consider the example of adding the BCD digits 9 (binary 1001) and 1 (binary 0001) with no incoming carry: the binary sum is 1010 (10 decimal), which exceeds 9, so add 6 (0110) to get 10000 (16 decimal), yielding a corrected low nibble of 0000 (0) and C_out = 1. If this is the units digit in a multi-digit number, the carry propagates to the next higher digit's addition. For multi-digit addition in packed BCD format, where two digits are stored per byte (low for units, high for tens), the process is repeated digit-by-digit from right to left, propagating the carry from each to the next. In systems like early mainframes, this ensures compatibility with decimal-oriented peripherals, though some variants (e.g., certain legacy accounting machines) incorporate end-around carry for specific modes to handle sign propagation in signed BCD representations. The final result maintains the packed structure, with the most significant digit potentially generating an carry if needed.

Subtraction and Multiplication

Subtraction in binary-coded decimal (BCD) is commonly performed using the 10's complement method, which transforms the operation into an by complementing the subtrahend and then applying BCD rules to the minuend. This approach avoids direct borrowing across digits, leveraging the same correction mechanisms as BCD (adding 6 to each if the sum exceeds 9). To compute the 10's complement of a BCD number, first find the 9's complement by subtracting each D from 9 (i.e., $9 - D), then add 1 to the result, propagating any carry to higher digits. The subtraction proceeds as follows: (1) obtain the 9's complement of the subtrahend; (2) add 1 to convert it to the 10's complement; (3) add this complement to the minuend using standard BCD addition with per-nibble corrections. If a carry is generated from the most significant , discard it to obtain the positive result (end-around carry may apply for the least significant in some implementations); absence of carry indicates a negative result, which can be handled by taking the 10's complement of the outcome. For example, consider subtracting 13 from 25 in two-digit . The subtrahend 13 has a 9's complement of 86 (9-1=8, 9-3=6). Adding 1 yields the 10's complement 87. Adding 25 + 87 = 112 (in : 0010 0101 + 1000 0111 = 1010 1100, corrected for BCD by adding 0110 to exceeding 9, but the sum illustrates ). Discarding the carry 1 gives the result 12. An alternative direct method involves subtracting digit-by-digit with borrowing, applying a correction by subtracting 6 from the result if a borrow occurs, to maintain valid BCD encoding. Multiplication in BCD is typically implemented using a shift-and-add analogous to binary , but with partial products generated and accumulated via BCD instead of binary . The multiplicand is shifted left by multiples of one position (equivalent to multiplying by powers of 10, implemented as left shifts by 4 bits in packed BCD), and added to the accumulator if the corresponding multiplier is non-zero, with BCD corrections applied after each . For with single , precomputed lookup tables can store the BCD-encoded products of two (0-9 × 0-9), reducing computation to table access and accumulation. Division in BCD operates as the reciprocal of , often using a shift-and-subtract loop: the dividend is repeatedly compared to the shifted , subtracting (via 10's complement addition) when possible and incrementing the , akin to but with BCD arithmetic for each step.

Implementations in Systems

Mainframe and IBM Systems

's System/360 architecture, announced in 1964, pioneered native hardware support for binary-coded decimal (BCD) to address the needs of commercial computing, particularly for accurate decimal handling in business applications. The design incorporated instructions for both packed BCD, which stores two s per byte, and zoned BCD, which uses one byte per with zone bits for character integration. This enabled efficient processing of financial data without the rounding errors common in binary floating-point representations. Key instructions included PACK for converting zoned decimal to packed format, UNPACK for the reverse, and arithmetic operations such as ADD DECIMAL (AP) for addition, SUBTRACT DECIMAL (SP) for subtraction, MULTIPLY DECIMAL (MP), and DIVIDE DECIMAL (DP). These instructions operate on fields up to 31 digits plus a , packed into 16 bytes, with the CPU's decimal units performing native BCD addition and subtraction to support languages like . Hardware decimal adder circuits in the directly manipulated BCD digits, ensuring precision for transactional workloads. In mainframes, zoned BCD integrates seamlessly with the , serving as the default representation for numeric character data in files and displays, where each digit occupies the low-order four bits of a byte and the high-order bits encode the zone (typically F for numeric digits). This format facilitated I/O operations and data interchange in early systems. Support for BCD persisted into the series of the 1970s, where instructions like those in System/360 were enhanced for extended addressing, with decimal arithmetic remaining a core feature for compatibility. By the post-2000 z/Architecture era, BCD instructions continued to be fully implemented for , even as binary operations dominated general-purpose computing, allowing legacy banking and financial software to run unchanged on modern hardware. In contemporary systems, BCD usage has declined for new applications but remains vital for precise decimal computations in sectors like banking, where packed BCD ensures exact representation of monetary values in COBOL-based . Subsequent processors, including z15 (2019) with Enhanced Vector Facility, z16 (2022) with Advanced Vector Facility for packed decimals, and z17 (2025) with continued decimal support including decimal floating point packed conversion, further enhance BCD performance for AI-integrated workloads. Modern hybrids include for Java's BigDecimal , which emulates arbitrary-precision decimals using underlying BCD facilities to match mainframe-native performance. Additionally, the z14 processor introduced the Vector Packed Decimal Facility in 2017, enabling SIMD-style operations on BCD data in 16-byte vector registers to accelerate legacy workloads without code changes.

Microprocessors and Other Computers

Binary-coded decimal (BCD) support in microprocessors and other non-mainframe computers has primarily manifested through specialized instructions for adjusting binary arithmetic results to valid BCD representations, reflecting the need for precise decimal computations in early personal and systems. The microprocessor, introduced in 1978, included the Decimal Adjust After Addition (DAA) and Decimal Adjust After Subtraction () instructions to facilitate packed BCD operations. These instructions operate on the AL register, assuming two unpacked BCD digits (one in the upper and one in the lower ), and correct the result of a prior ADD or instruction by adding or subtracting 6 from the affected if it exceeds 9 or if the auxiliary is set, thereby ensuring the final value remains a valid BCD number. For example, the DAA instruction's is as follows:
if (AL > 9) or (AF == 1) then
    AL = AL + 6
    CF = (CF or (original_AL > 9))
end if
if (AH > 9) or (CF == 1) then
    AH = AH + 6
    CF = 1
end if
This adjustment mechanism updates the (CF) and auxiliary carry flag (AF) accordingly, enabling efficient BCD arithmetic without full hardware decimal adders. Similar instructions, such as (ASCII Adjust After Addition) and AAS (ASCII Adjust After Subtraction), extend support to zoned BCD formats using ASCII encoding. In extensions to the x86 , AMD64 maintains compatibility with these BCD instructions but restricts their use to 16-bit and 32-bit modes, excluding them from 64-bit due to performance overhead and the dominance of arithmetic in modern computing. architectures, designed as reduced instruction set computing (RISC) processors, do not include dedicated hardware BCD operations as standard features; any BCD handling is implemented via software routines, though some vendor-specific extensions or interfaces may offer optional decimal support in contexts. Historical minicomputers like the DEC PDP-11 provided limited BCD support through software libraries for decimal arithmetic, relying on instructions for core operations. In contrast, the DEC VAX , evolving from the PDP-11 in the late , incorporated native instructions for decimal string operations, including packed BCD formats compatible with zoned encodings, such as MOVTC for character translation and addition/subtraction on variable-length decimal strings. These VAX instructions treated BCD data as numeric strings, supporting up to 31 digits with sign, and were optimized for business applications requiring exact . Burroughs Corporation's medium and large systems from the 1950s through the 1980s, such as the B5000 (1959) and B6700 (1971), were designed with native BCD arithmetic units using a to execute efficiently. These machines performed serial, character-at-a-time decimal operations on BCD-encoded data, storing numbers as alphanumeric strings in memory with each digit occupying six bits (including a zone bit), and utilized a for operand handling without general-purpose registers. This approach minimized conversion overhead for decimal I/O and arithmetic, making Burroughs systems particularly suited for financial and accounting tasks during that era. In contemporary systems lacking hardware BCD support, software emulations prevail, such as Python's module, which implements arbitrary-precision arithmetic using BCD-like internal representations to avoid floating-point rounding errors in financial calculations. Field-programmable gate arrays (FPGAs) also enable custom BCD implementations, where designers replicate adders and adjusters in for specialized applications like emulation or high-speed . The overhead of BCD operations—typically 2-3 times slower than due to adjustment steps and larger data widths—has led to sparse support in post-1990s RISC and CISC processors, favoring software libraries for needs in general-purpose .

Hardware and Electronics Usage

Digital Circuits for BCD

Binary-coded decimal (BCD) digital circuits are designed to perform arithmetic operations on decimal digits represented in binary form, ensuring that each 4-bit nibble corresponds to a valid decimal value from 0 to 9. These circuits are essential in implementations where decimal accuracy is paramount, such as in financial systems and calculators. A fundamental component is the BCD , which adds two BCD digits along with a possible carry-in, producing a BCD and carry-out. The design incorporates correction logic to handle cases where the binary exceeds 9, preventing invalid BCD representations. The BCD adder circuit typically employs a full structure augmented with correction logic implemented using AND for detecting invalid sums and a (MUX) for adding 6 (binary 0110) when necessary. Specifically, the detection logic identifies conditions where the intermediate binary sum is greater than 9 or generates an auxiliary carry, triggering the addition of 6 to adjust the result back to a valid BCD range. This correction ensures decimal integrity without altering the underlying . The logic uses to compute a correction signal, often defined as K = S3·S2 + S3·S1 + C4, where S3–S0 are the bits of the initial sum and C4 is the carry from the first addition stage. At the gate level, a 4-bit BCD adder is constructed using two 4-bit adders in series. The first adder computes the initial of the two 4-bit BCD inputs (A3–A0 and B3–B0) plus a carry-in, yielding a 4-bit (S3–S0) and an auxiliary carry (C4). If the correction signal K is active (indicating S > 9 or C4 = 1), the second adder adds 0110 to this , producing the final BCD outputs (final S3–S0) and the overall carry-out. This serial arrangement leverages standard full adders, minimizing custom logic while introducing a small delay for correction. The carry-out from the second adder serves as the decimal carry to the next digit. For multi-digit BCD addition, carry is managed through chainable designs analogous to adders but adapted for correction at each stage. Ripple-carry BCD adders connect the carry-out of one 4-bit stage to the carry-in of the next, propagating the decimal carry sequentially; this is simple but incurs cumulative delays proportional to the number of digits. In contrast, carry-lookahead BCD adders (CLA) precompute generate and propagate signals across digits, incorporating adjustment logic to reduce delay, making them suitable for high-speed applications despite increased complexity. These adaptations ensure efficient handling of carries in contexts, with CLA variants offering logarithmic delay scaling for longer operands. An example for a single-digit 4-bit BCD takes inputs A3–A0 and B3–B0 (each representing digits 0–9), along with a carry-in (Cin). The first 4-bit outputs temporary bits T3–T0 and auxiliary carry Caux. The correction then evaluates if (T3–T0 > 1001 or Caux = 1), activating the MUX to select either 0000 or 0110 for addition in the second 4-bit , which produces final bits S3–S0 and carry-out Cout. This design ensures the output S3–S0 is a valid BCD , with Cout indicating a carry of 1. BCD circuits have been integrated into arithmetic logic units (ALUs) of early microprocessors to support decimal operations. For instance, the , released in 1971, featured a 4-bit ALU with a instruction that implemented BCD correction logic post-binary , enabling efficient decimal in calculator applications. This hardware support for BCD adjustment was crucial for the chip's target use in Busicom's decimal-based systems. Due to the additional correction logic and serial adder stages, BCD circuits exhibit higher and power consumption compared to pure binary counterparts.

Displays and Peripherals

Binary-coded decimal (BCD) plays a crucial role in interfacing digital systems with output devices that require direct , particularly in visual displays and input peripherals. One prominent application is in seven-segment displays, where BCD-to-seven-segment decoder chips convert 4-bit BCD codes into signals that activate the appropriate LED or LCD segments to form decimal digits. The SN54LS47, a low-power Schottky , exemplifies this by accepting BCD inputs on pins A-D and driving common-anode seven-segment displays via active-low outputs on pins a-g, ensuring efficient segment illumination without binary-to-decimal conversion overhead. The conversion logic maps each BCD digit from 0000 () to 1001 (9) to a unique combination of the seven segments (labeled a through g), with invalid BCD codes (1010 to 1111) typically blanking the display to prevent erroneous symbols. For instance, BCD 0000 activates segments a, b, c, d, e, and f while deactivating g to display ''. The following table illustrates the output states for digits 0-9, where 0 indicates an active (lit) segment and 1 indicates inactive:
BCD InputabcdefgDigit
00000000001
000110011111
001000100102
001100001103
010010011004
010101001005
011001000006
011100011117
100000000008
100100001009
This mapping, derived from standard decoder designs, ensures precise decimal visualization in devices like digital clocks and meters. In input peripherals, BCD encoding facilitates accurate decimal data entry, as seen in punch card systems using Hollerith code for 80-column cards with 12 punch rows per column. Decimal digits 0-9 are encoded by punching the corresponding row (0 through 9), forming a direct BCD representation that allows mechanical or optical readers to interpret numeric data without complex decoding. Zone punches in rows 11 and 12 extend this for alphanumeric use, but pure numeric fields rely on the 10-row BCD subset for reliable tabulation in early data processing. Early handheld calculators leveraged BCD for both internal arithmetic and display accuracy to avoid floating-point rounding errors in decimal results. The , introduced in 1972, processed 14-digit BCD words in a bit-serial manner, enabling precise trigonometric and exponential functions to be shown directly on its seven-segment without binary conversion artifacts. Similarly, ' early models, such as those using the TMS0100 chipset from the early 1970s, represented numbers as BCD with four bits per digit, supporting accurate decimal output on LED panels in devices like the TI SR-10. BCD extends to other peripherals like printers and terminals, where it ensures decimal output fidelity by delivering digit-by-digit codes to print heads or screens, minimizing errors in financial or scientific printouts. For example, legacy line printers interfaced via BCD signals to drive solenoid-actuated typebars for each digit, providing straightforward to printed numerals. In terminals, BCD inputs to display drivers maintained exact decimal rendering, as in systems requiring isolated BCD outputs for serial-to-decimal translation. In modern embedded systems, BCD interfaces persist in LCD and LED drivers for applications demanding decimal precision, such as industrial panels and automotive dashboards. Chips like the CD4511 CMOS BCD-to-seven-segment decoder continue to be integrated for low-power operation, accepting BCD inputs to control multiplexed displays in microcontrollers, ensuring compatibility with legacy decimal protocols while supporting energy-efficient designs.

Comparison to Binary

Advantages

Binary-coded decimal (BCD) provides precise representation of numbers, avoiding the rounding errors common in floating-point arithmetic. Unlike floating-point, where fractions such as 0.1 lack an exact counterpart and lead to approximations (e.g., 0.1 + 0.2 yielding approximately 0.30000000000000004 instead of exactly 0.3), BCD encodes each in a four-bit group, ensuring exact storage and computation of values. This precision is essential in domains requiring accurate handling, such as financial systems, where even slight discrepancies can accumulate and affect outcomes. The direct correspondence between BCD nibbles and decimal digits enhances human readability and simplifies input/output processes. In applications like financial software, this mapping allows developers and users to inspect and debug numeric data intuitively, as each four-bit segment translates straightforwardly to a single decimal digit without needing binary-to-decimal conversion routines. This feature streamlines , , and tasks. BCD facilitates seamless compatibility with decimal-oriented peripherals and , including calculators, meters, and seven-segment displays. By aligning naturally with devices engineered for base-10 output, BCD reduces the of , eliminating the need for additional logic and enabling efficient data exchange in and systems. The six unused codes ( 10–15, or A–F) in each four-bit BCD enable built-in error detection mechanisms. These spare combinations can be designated for checks or to indicate invalid digits, allowing systems to detect transmission errors or reliably without extra overhead. For exact decimal computations, BCD offers benefits in scenarios like financial calculations, where operations involving factors of ten (e.g., or ) are simpler and avoid the conversion penalties of formats. Although storing a number like 999 consumes 12 bits in BCD (four bits per digit) versus 10 bits in pure , this trade-off ensures no loss from decimal approximations, making BCD preferable for applications prioritizing accuracy over .

Disadvantages

Binary-coded decimal (BCD) representations require four bits to encode each from 0 to 9, resulting in a overhead compared to pure encoding, where approximately 3.32 bits are needed on average per decimal digit due to \log_2(10) \approx 3.32. For instance, a 10-digit decimal number occupies 40 bits in standard BCD but only 34 bits in (calculated as \lceil 10 \times \log_2(10) \rceil = 34), leading to up to 20.4% more space for BCD in large datasets. This inefficiency arises because BCD dedicates full 4-bit nybbles even though only 10 of the 16 possible combinations are used, wasting capacity for values 10 through 15. Arithmetic operations in BCD are slower than in due to the need for correction steps after initial or to ensure valid digits. For example, if the sum of two BCD digits exceeds 9, an adjustment (typically adding 6) is required to correct the result and generate a carry, adding complexity and to each operation. implementations of BCD units, such as ALUs, demand additional circuitry for these adjustments, increasing count and elevating power consumption relative to counterparts. The fixed 4-bit structure of standard BCD inherently limits its range to decimal digits per nybble, providing no native support for higher-radix operations or non-decimal values without custom extensions or conversions, which further complicates design. In modern computing, BCD has become largely legacy because binary integer and floating-point formats suffice for most non-financial applications, offering superior density, speed, and optimization without the decimal precision pitfalls that BCD addresses only in niche scenarios.

Representational Variations

Signed BCD Formats

Signed binary-coded decimal (BCD) formats extend unsigned BCD representations to handle positive, negative, and zero values by incorporating sign information, typically using either a dedicated sign nibble or overpunching the sign into the representation of the least significant digit. These methods are prevalent in legacy systems like IBM mainframes, where decimal accuracy is critical for applications such as financial computing. In packed BCD, also known as packed decimal format in systems, the is stored in the high-order of the low-order byte, allowing the remaining nibbles to represent the digits. The standard codes are hexadecimal C (binary 1100) for positive values, D () for negative values, and F () for unsigned values. For example, the positive number + is encoded as two bytes: 0x12 3C, where the low-order byte combines the digit 3 (0011) with the positive C (1100). The negative counterpart - uses 0x12 3D, substituting the negative D. This -magnitude approach keeps the digit values unchanged for the absolute magnitude while isolating the , facilitating straightforward arithmetic operations after adjustment. Zoned BCD formats, common in EBCDIC-encoded data on IBM platforms, allocate a full byte per decimal digit, with the high-order nibble (zone) typically set to F (1111) for unsigned digits 0-9 (resulting in codes F0 to F9). For signed values, the zone nibble of the least significant digit is overpunched to indicate the sign, using C (1100) for positive and D (1101) for negative, while preserving the low-order digit nibble. For instance, +123 in zoned EBCDIC appears as F1 F2 C3, and -123 as F1 F2 D3. Alternative positive signs like A, E, or F and negative signs like B may appear in non-preferred formats, but IBM's NUMPROC(PFD) option standardizes to C, D, and F for consistency. This overpunch method embeds the sign directly into the printable character representation, aiding legacy data interchange. Beyond sign-magnitude representations, some BCD systems employ 10's complement for negative values, where the sign is not stored separately but instead each digit of the magnitude is subtracted from 9 (9's complement) and then 1 is added to the least significant digit, effectively using the full field for the complemented value. This approach, analogous to in binary, simplifies by treating it as but is less common in formats like IBM's, which favor sign-magnitude for direct decimal readability. In financial BCD applications, zero handling distinguishes +0 (e.g., C0 in zoned or with positive sign in packed) from -0 (D0 or negative sign), preserving debit/credit semantics even for null balances in ledgers.

Telephony BCD (TBCD)

Telephony BCD (TBCD) is a packed binary-coded decimal encoding scheme optimized for representing telephone numbers and addresses in mobile telecommunications protocols, particularly within the and subsequent standards. Defined as an OCTET STRING in notation for the , it supports digits 0-9 along with telephony-specific characters *, #, a, b, and c, using a filler character F for padding. This format emerged in the 1990s as part of GSM specifications to efficiently transmit numeric addressing data over limited bandwidth links. The structure of TBCD encodes two decimal digits per octet, with the high-order nibble holding the more significant digit and the low-order nibble the less significant one. Digits are packed starting from the most significant digit in the high-order nibble of the first octet, the next digit in the low-order nibble of the first octet, and so on, up to the least significant digit in the low-order nibble of the last octet (for even length) or high-order nibble (for odd length, with low-order nibble set to F). Each digit 0-9 is directly mapped to its hexadecimal equivalent (0x0 to 0x9), while * maps to 0xA, # to 0xB, a to 0xC, b to 0xD, c to 0xE, and the filler to 0xF. When the total number of digits is odd, the unused low-order nibble in the final octet is filled with 0xF. In address fields, leading zeros are omitted unless part of the number. In SMS protocols, TBCD encodes originator and destination addresses within the Transfer Protocol Data Unit (TPDU) as outlined in GSM 03.40. The address field begins with a one-octet length indicator (number of semi-octets for the address value, i.e., the number of digits), followed by a type octet combining Type of Number (TON) and Numbering Plan Identification (NPI), and then the TBCD-packed address value. For an international number like +1234567890 (digits 1234567890), TON=001 (international) and NPI=0001 (E.164/ISDN) yield a type octet of 0x91, with the address value packed as 0x12 0x34 0x56 0x78 0x90. The filler 0xF ensures even nibble alignment for odd-length addresses, such as +123456789 (digits 123456789) becoming length 0x09, type 0x91, followed by 0x12 0x34 0x56 0x78 0x9F. This semi-octet packing allows up to 20 digits in 10 octets, balancing density and protocol efficiency. TBCD differs from standard BCD by omitting bits or indicators, focusing solely on unsigned numeric and representation for addressing purposes. It employs a consistent two-digits-per-octet scheme without variable , enabling fixed in stacks; for instance, an octet pair accommodates exactly four digits, streamlining data handling compared to zoned formats. and NPI precede the digits to denote context like or numbering, absent in general BCD. Conversion from ASCII or string to TBCD involves extracting , mapping each to its 4-bit value, and interleaving into octets with high/low assignment starting from the most significant . Special handling for /NPI sets the type octet—e.g., 0x91 for international —before appending the packed value; decoding reverses the process, extracting nibbles from high to low per octet to reconstruct from most to least significant while ignoring fillers. This ensures compatibility with legacy equipment. TBCD's use expanded in post-2000 releases for operations in and beyond, appearing in specifications like TS 29.002 for signaling messages such as location updates and routing. While integral to legacy / interfaces, it sees partial replacement by UCS-2 or in modern IP-based over IMS to support international characters, though TBCD persists in core network for .

Applications

Financial Computing

Binary-coded decimal (BCD) plays a critical role in financial computing by enabling exact representation and manipulation of numbers, particularly in handling values where precision to the or smaller units is mandatory. In banking and systems, binary floating-point formats can introduce errors—for instance, repeated additions of 0.10 may not yield exactly 1.00 due to base-2 approximations—whereas BCD stores each in a 4-bit , preserving exactness without drift. This precision is essential for applications like calculations and balance updates, preventing cumulative discrepancies that could lead to regulatory non-compliance or financial losses. Standards such as those governing in financial systems, including the SQL , often leverage BCD implementations to ensure and accuracy in data storage and exchange. In , for example, columns are stored using packed BCD format, where two digits occupy one byte plus a sign , supporting up to 31 digits of precision for financial records. , a staple in legacy financial software, integrates BCD through the COMP-3 (packed decimal) usage in PICTURE descriptions, allowing programmers to define fields like PIC 9(9)V99 COMP-3 for exact storage of amounts up to nine integer digits and two places, facilitating reliable operations in . Practical examples include mainframe-based banking systems where BCD formats process transaction amounts without conversion losses, as seen in environments handling high-volume financial data. Modern languages persist this approach through decimal types for arbitrary : Java's BigDecimal uses an array-based of digits, ideal for financial APIs and compliance-driven calculations, while .NET's System.Decimal employs a 128-bit structure supporting 28-29 significant digits with base-10 scaling, explicitly recommended for monetary computations to avoid floating-point pitfalls.

Telecommunications and Legacy Systems

In telecommunications protocols, binary-coded decimal (BCD) ensures precise encoding of decimal digits for phone numbers and billing information. BCD (TBCD), an extension of BCD tailored for , is applied in the Signaling System No. 7 (SS7) , where each digit in the called party number within the Initial Address Message is represented by 4-bit BCD codes to facilitate call setup and routing. In the Global System for Mobile Communications (), TBCD encodes calling and called party numbers in Call Detail Records (CDRs) for billing and charging, as defined in mediation system specifications for offline processing of usage data. The Integrated Services Digital Network (ISDN) also relies on BCD for signaling, with the ITU-T Q.931 standard using a semi-octet BCD format to encode calling and called party numbers, where each digit occupies 4 bits alongside indicators for number type and plan identification. This approach supports basic call control by maintaining compatibility with decimal-based telephony addressing. BCD endures in legacy systems due to its decimal accuracy in environments requiring exact numeric handling. IBM mainframes running MVS and OS/390 (precursors to z/OS) extensively use packed decimal, a compact BCD variant, for storing and processing numeric data such as transaction amounts and dates in telecommunications and enterprise applications. The Year 2000 (Y2K) issue exposed vulnerabilities in these BCD-based date fields, prompting fixes like expanding BCD representations to support four-digit years while preserving legacy record layouts in mainframe software. In point-of-sale (POS) terminals and automated teller machines (ATMs), the standard governs transaction messaging and utilizes packed BCD for key fields like amounts, encoding two digits per byte to optimize and avoid floating-point errors in calculations. This format persists in legacy payment infrastructures interfacing with mainframes for and . Migration challenges from BCD-based systems remain in sectors like , where mainframes continue to rely on packed decimal for high-volume , complicating transitions to formats due to and requirements.

Alternative Encodings

Higher-Density BCD Variants

Standard binary-coded decimal (BCD) representations allocate 4 bits per decimal digit, yielding a density of 4 bits per digit (bpd), which exceeds the theoretical minimum of \log_2 10 \approx 3.32 bpd needed to encode decimal information in binary without loss. Higher-density BCD variants optimize this by compressing multiple digits into fewer bits using fixed or variable-length codes, aiming to approach the information-theoretic limit while preserving the decimal structure for compatibility with existing BCD systems. These approaches typically involve trade-offs, such as increased computational overhead for encoding and decoding, and challenges in performing arithmetic directly on the compressed form without full expansion. The Chen-Ho encoding, developed by T. C. Chen and I. T. Ho in , represents a foundational higher-density variant that packs three digits into 10 bits, achieving an effective density of 3.333 bpd with minimal wastage of 0.34% relative to the maximum possible combinations. This fixed-length scheme employs a combinatorial mapping akin to a for digit triples, where the three 4-bit BCD digits are rearranged (often by or permuting) and adjusted using 2 additional bits to uniquely represent all 1,000 possible three-digit combinations within the 1,024 available 10-bit values. For instance, common low-value digits benefit from efficient bit allocation in the mapping, allowing subsets like 000 to map directly to all-zero bits. However, the non-uniform bit distribution across digit groups introduces decoding overhead, as reverse mapping requires checking permutations to recover the original order. Other higher-density variants include biased BCD schemes, which shift the standard 4-bit codes (e.g., adding a like 3 in BCD) to facilitate compression in specific contexts, such as easing carry propagation or enabling better packing in variable scenarios, though they generally maintain close to 4 unless combined with multi-digit grouping. Additionally, 10-bit-per-3-digit schemes, building on Chen-Ho principles, have been explored for further optimization, such as in patents extending for variable-length extensions where groups of N use proportionally fewer bits. An illustrative example of a variable-length extension inspired by these methods might encode frequent with shorter codes—e.g., 1 as 01 (2 bits), 2 as 10 (2 bits), and 3 as 11 (2 bits)—yielding 6 bits total for the number 123, averaging below 3.32 for digit streams dominated by low values using a prefix-free . Arithmetic operations on higher-density BCD encodings pose significant challenges due to non-uniform lengths or mappings, often necessitating alignment of digit groups, partial decoding during or , and handling carry across compressed boundaries, which can increase compared to standard BCD in implementations. Despite these complexities, such variants remain rare in practice, primarily confined to academic research and specialized proprietary systems for financial data where storage savings justify the overhead.

Non-BCD Decimal Methods

The IEEE 754-2008 standard defines decimal floating-point formats that store decimal numbers in binary form while preserving exact decimal , serving as a modern alternative to traditional BCD for applications needing decimal fidelity without binary rounding errors. These formats include decimal32, which uses 32 bits to encode up to 7 decimal digits in the with an exponent range of -95 to +96, and decimal64, which employs 64 bits for up to 16 decimal digits with an exponent range of -383 to +384. Unlike BCD, which allocates fixed 4 bits per digit, these formats use variable-density encoding for the combined with a biased exponent and , enabling compact representation of decimal values in binary hardware. Two primary encodings for the significand in these formats are Binary Integer Decimal (BID) and Densely Packed Decimal (DPD). BID, developed by , represents the significand as a single binary integer equivalent to the decimal value, padded to full precision with leading zeros if necessary, and includes a short "cohort" field to specify the actual number of digits for shorter values, improving density. For instance, the decimal number 123 in BID (assuming a format supporting at least 3 digits, like a subset of decimal32) has a significand of 01111011 (the 8-bit binary for 123), with the cohort encoding indicating 3 digits to avoid trailing zeros in interpretation. DPD, designed by , compresses groups of three digits into 10 bits using a nonlinear that ensures all valid BCD combinations are representable, facilitating efficient between decimal strings and packed storage. BID and DPD offer trade-offs in performance: BID supports faster arithmetic operations by directly utilizing binary integer hardware for and , though it requires conversion for decimal input/output, while DPD excels in decimal-to-binary conversions but demands specialized logic for arithmetic, making it preferable for systems with frequent human-readable interfaces. Both maintain decimal-exact results for operations like and , addressing BCD's inefficiencies in , and are implemented in software libraries for precise decimal , such as those in financial and scientific applications. Additional non-BCD decimal methods include variants for decimal digits, which assign binary codes to 0-9 such that successive digits differ by exactly one bit, minimizing transition errors in electromechanical devices like rotary dials or shaft encoders. Unary decimal encoding represents digits 0-9 with 1 to 10 asserted bits (e.g., 0000000000 for 0, 1111111111 for 9), useful only for tiny ranges in specialized counters due to its extreme space inefficiency. Historically, encoding provided a simple decimal alternative by adding 3 (binary 0011) to each standard 4-bit digit code, yielding self-complementing representations (e.g., 0 becomes 0011, 9 becomes 1100) that simplify 9's complement subtraction without full BCD addition circuitry, and was employed in calculators and early computers for arithmetic ease.

References

  1. [1]
    What is binary-coded decimal and how is it used? - TechTarget
    Jun 28, 2022 · Binary-coded decimal is a system of writing numerals that assigns a four-digit binary code to each digit 0 through 9 in a decimal (base 10) number.
  2. [2]
    Binary Coded Decimal - an overview | ScienceDirect Topics
    Binary-coded decimal (BCD) is defined as a number system that encodes the decimal digits 0 through 9 using their 4-bit binary representations.Introduction to Binary-Coded... · Arithmetic Operations with... · Applications and...
  3. [3]
    Fundamentals of Binary-Coded Decimal (BCD) - Technical Articles
    Jul 7, 2023 · This article provides an introduction to the computational number system known as binary-coded decimal or BCD.
  4. [4]
    Why do we use BCD code? (Binary coded Decimal) - EEVblog
    Dec 3, 2019 · A BCD counter rolls over from 9 to 0. The most familiar example of a BCD computer is the IBM 650. This was a fully-decimal computer, using BCD ...<|separator|>
  5. [5]
    Binary Coded Decimal or BCD Numbering System
    Binary Coded Decimal, or BCD, is another process for converting decimal numbers into their binary equivalents.
  6. [6]
    What Is BCD (Binary-Coded Decimal)? Simple Explanation with ...
    Feb 24, 2020 · Binary-coded decimal or BCD is a code using a series of binary digits or bits that, when decoded, represent a decimal digit.Bcd System · Bcd Conversion · Bcd Applications
  7. [7]
    BCD or Binary Coded Decimal - GeeksforGeeks
    Jul 15, 2025 · Binary Coded Decimal (BCD) is a binary encoding system in which each decimal digit is represented by a fixed number of binary bits, typically four.
  8. [8]
    3 Computer Arithmetic - Robert G. Plantz
    The Binary Coded Decimal (BCD) code is a code for individual decimal digits. Since there are ten decimal digits, the code must use four bits for each digit. The ...
  9. [9]
    [PDF] CSE 241 Number Systems & Binary Arithmetic
    Binary Coded Decimal. Represents decimal digits. 0 → 9. Weighted Codes. Position of 1 indicates weight. 8421 Code. Weighted Code. Most common BCD code.
  10. [10]
    [PDF] Lecture Notes for Digital Electronics - University of Oregon
    Another convention is called BCD (“binary coded decmal”). In this case each decimal digit is separately converted to binary. Therefore, since 7 = 01112 and ...
  11. [11]
    3 Bessie --- The Automatic Sequence Controlled Calculator
    The fundamental calculating element of the Mark I was a wheel that could assume one of ten positions, for the ten decimal digits, just like a desk calculator. ( ...
  12. [12]
    Mysteries of the Ancients: Binary Coded Decimal (BCD) - EEJournal
    Jan 19, 2023 · Early in this paper, we introduced the BCD 8421 code in which each decimal digit is encoded using four binary bits. Let's assume this is the ...Missing: history | Show results with:history
  13. [13]
    Doug Jones's punched card codes - University of Iowa
    IBM's BCD codes were all more complex, partly because of a desire to represent the numeral zero with the 6-bit numeric code 000000 (in the IBM 704, 709 ...Missing: history | Show results with:history
  14. [14]
    [PDF] Architecture of the IBM System / 360
    This paper discusses in detail the objectives of the design and the rationale for the main features of the architecture. Emphasis is given to the problems ...
  15. [15]
    Why COBOL Still Dominates Banking—and How to Modernize
    May 16, 2024 · Legacy COBOL applications are still crucial in banking & government sectors. Learn steps for application modernization & the value of ...
  16. [16]
    Packed-Decimal Format, Description and Discussion - SimoTime
    A packed decimal representation stores decimal digits in each "nibble" of a byte (a byte is eight bits and a nibble is four bits).Introduction · Table, Packed-Decimal Field... · Convert Packed-Decimal to Text
  17. [17]
    Chen-Ho Encoding and Densely Packed Decimal
    One form of Chen-Ho encoding allows three decimal digits to be represented in ten binary bits, which may have up to 1,024 possible different values, and which ...Missing: density | Show results with:density
  18. [18]
    Densely Packed Decimal encoding - speleotrove.com
    Chen-Ho encoding compresses three decimal digits into 10 bits with a 0.34% wastage, giving a 20% more efficient encoding than simple BCD (one digit in 4 bits).Missing: density | Show results with:density
  19. [19]
    Sign representation of zoned and packed-decimal data - IBM
    Sign representation of zoned and packed-decimal data. Sign representation affects the processing and interaction of zoned decimal and internal decimal data.Missing: storage | Show results with:storage
  20. [20]
    Zoned-Decimal Format - IBM
    Zoned-decimal format means that each byte of storage can contain one digit or one character. In the zoned-decimal format, each byte of storage is divided into ...
  21. [21]
    [PDF] BINARY-CODED DECIMAL (BCD)
    In computing and electronic systems, binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary.<|control11|><|separator|>
  22. [22]
    About EBCDIC and ASCII Data - SAS Help Center
    On an EBCDIC system, the digit 4 is represented by the hexadecimal value 'F4'x. On an ASCII system, the digit 4 is represented by the hexadecimal value '34'x.
  23. [23]
    The EBCDIC character set - IBM
    ASCII and EBCDIC are both 8-bit character sets. The difference is the way they assign bits for specific characters.
  24. [24]
    DFSORT data formats - IBM
    ZD, (zoned decimal, signed). Each digit of the decimal number is converted into its 8-bit EBCDIC representation. The sign indicator replaces the first four bits ...
  25. [25]
    [PDF] Binary coded decimal addition and subtraction
    Addition is performed on a BCD digit by BCD digit basis (not bit by bit) from right to left. Subtraction is carried out by adding the ten's complement negative ...
  26. [26]
    BCD or Binary Coded Decimal | BCD Conversion Addition Subtraction
    Jun 15, 2024 · BCD addition requires adding binary numbers and adjusting results greater than 9 by adding 6.: BCD subtraction can be done using methods like 1 ...
  27. [27]
    BCD Adder in Digital Logic - GeeksforGeeks
    Aug 28, 2024 · A BCD adder is a circuit for the addition of two binary-coded decimal numbers. BCD is another format used in representing numbers where each digit will be ...
  28. [28]
    Jones on BCD Arithmetic - University of Iowa
    Binary coded decimal numbers may be represented in a number of ways. The most obvious is packed BCD, where each decimal digit is represented by a 4 bit field, ...Missing: history | Show results with:history
  29. [29]
    [PDF] CPSC 352 Chapter 3: Arithmetic
    Subtraction is carried out by adding the ten's complement nega- tive of the subtrahend to the minuend. • Ten's complement negative of subtrahend is obtained by ...
  30. [30]
    BCD Subtraction | 9s Complement | 10s Complement - eeeguide.com
    The BCD Subtraction using 10s Complement can be used to perform subtraction by adding the minuend to the 10s Complement of the subtrahend and dropping the carry ...
  31. [31]
    [PDF] Design and Evaluation of Decimal Array Multipliers - ece.ucsb.edu
    In this paper, we offer two decimal array multiplier designs for conventional binary-coded-decimal (BCD) operands: one is based on selecting the partial ...
  32. [32]
    (PDF) Binary-coded decimal digit multipliers - ResearchGate
    Aug 7, 2025 · A BCD-digit multiplier produces a two-BCD digit product from two input BCD digits. We provide a novel design for the latter, showing some advantages in BCD ...
  33. [33]
    [PDF] Systems Reference Library IBM System/360 System Summary
    This publication provides basic information about the IBM System/360, with the objective of helping readers to achieve a general understanding of this new.
  34. [34]
    Packed Decimal Instructions
    To convert from zoned to packed. Format: label PACK D1(L1,B1),D2(L2,B2) - Packs the L2 byte zoned decimal number at D2(B2) and stores it as a L1 byte packed ...
  35. [35]
    [PDF] Systems Reference Library IBM System/360 System Summary
    The decimal field length, specified by the instruction, can be expanded to as many as 31 digits plus sign, all packed in. 16 bytes. High-order Byte. Figure 2-5.
  36. [36]
    [PDF] IBM z/Architecture Principles of Operation
    This edition obsoletes and replaces z/Architecture Principles of Operation, SA22-7832-12. This publication is provided for use in conjunction with other ...Missing: BCD | Show results with:BCD
  37. [37]
    Banking on mainframe-led digital transformation for financial services
    Banks have the most to gain if they succeed (and the most to lose if they fail) at bringing their mainframe application and data estates up to modern standards.Missing: BCD persistence
  38. [38]
    [PDF] IBM z16 (3931) Technical Guide - IBM Redbooks
    򐂰 Controls binary-coded decimal (BCD) operations better. 򐂰 Follows ... 򐂰 Java Applications that use the BigDecimal Class Library. 򐂰 SQL support as ...
  39. [39]
    [PDF] IBM z14 (3906) Technical Guide
    Jul 17, 2017 · This edition applies to IBM Z®: IBM z14™, IBM z13™, IBM z13s™, IBM zEnterprise EC12 (zEC12), and IBM. zEnterprise BC12 (zBC12). Note: Before ...
  40. [40]
    DAS — Decimal Adjust AL After Subtraction
    The DAS instruction then adjusts the contents of the AL register to contain the correct 2-digit, packed BCD result. If a decimal borrow is detected, the CF and ...
  41. [41]
    Understanding the x86's Decimal Adjust after Addition (DAA ...
    Jan 31, 2023 · The idea behind BCD is to store decimal numbers in groups of four bits, with each group encoding a digit 0-9 in binary. You can fit two decimal ...
  42. [42]
    CHAPTER SIX: THE 80x86 INSTRUCTION SET (Part 2) - Phat Code
    6.5.1.4 The AAA and DAA Instructions. The aaa (ASCII adjust after addition) and daa (decimal adjust for addition) instructions support BCD arithmetic. Beyond ...
  43. [43]
    Why BCD instructions were removed in AMD64? - Stack Overflow
    Oct 17, 2015 · The answer is in your link: Adding BCD numbers using these opcodes is a complex task, and requires many instructions to add even modest numbers.Why are x86 legacy instructions like BOUND or PUSHA not ...Packing BCD to DPD: How to improve this amd64 assembly routine?More results from stackoverflow.com
  44. [44]
    The Evolution from PDP-11 to VAX-11 to Alpha - Gordon Bell
    Very efficient encoding of programs was achieved by having a large number of instructions, including those for decimal arithmetic, string handling, queue ...
  45. [45]
    VAX MACRO and Instruction Set Reference Manual - VMS Software
    The VAX numeric string instructions support any encoding; however, VSI uses three encodings. These are as follows: Unsigned numeric encoding, in which there ...
  46. [46]
    [PDF] VAX Architecture Reference Manual
    ... PDP-11's small virtual address into a much larger physical memory. The VAX acronym itself (which originally stood for Virtual Address. eXtension) clearly ...
  47. [47]
    Burroughs Corporation - Wikipedia
    The Burroughs Corporation was a major American manufacturer of business equipment. The company was founded in 1886 as the American Arithmometer Company.Missing: native | Show results with:native
  48. [48]
    [PDF] Burroughs B 5000 - Bitsavers.org
    Arithmetic is performed on binary-coded decimal numbers in a serial, character- at-a-time manner. As a result, memory is treated as strings of alphanumeric ...
  49. [49]
    Short Burroughs History - Columbia University
    Jan 5, 2005 · 2K words of 10 digits + sign BCD, the usual arithmetic capabilities. For a few more bucks you could hang an extra rack on the side of the ...Missing: native | Show results with:native
  50. [50]
    [PDF] Novel BCD Adders and Their Reversible Logic Implementation for ...
    A BCD adder is a circuit that adds two BCD digits in parallel and produces a sum digit also in BCD. Fig. 1 shows the conventional BCD adder. A BCD adder must ...
  51. [51]
    BCD Adder Circuit | BCD Adder Truth Table - eeeguide.com
    A BCD Adder Circuit that adds two BCD digits and produces a sum digit also in BCD. BCD numbers use 10 digits, 0 to 9 which are represented in the binary form.
  52. [52]
    [PDF] Hardware Modeling of Binary Coded Decimal Adder in Field ...
    This research project aims to develop a decimal adder based on Ripple Carry. (RC) adder and Carry Look Ahead (CLA) adder in. FPGA. The development of the design ...
  53. [53]
    [PDF] Datasheet Intel 4004 - Index of /
    The 4004 easily interfaces with keyboards, switches, displays, A-D converters, printers and other peripheral equipment. The CPU can directly address 4K 8-bit ...Missing: design | Show results with:design
  54. [54]
    The Strangeness Of The Intel 4004 - The Chip Letter - Substack
    Sep 4, 2022 · Decimal Adjust Accumulator (DAA)​​ In BCD each decimal digit is stored in a four-bit nibble. To support this the 4004 had a 'DAA' or 'Decimal ...
  55. [55]
    [PDF] A Low-Voltage, Low-Power 4-bit BCD Adder, designed using ... - arXiv
    So, there is a trade-off in between the power consumption and the performance of the circuit. Several works have already been reported in literature to find ...
  56. [56]
    [PDF] A High-Speed BCD Adder using Single 4-Bit Binary Adder and ...
    Jun 30, 2019 · The proposed adder is very faster than conventional BCD adder since only two gate delays in the decimal carry but area has been increased due ...
  57. [57]
    [PDF] BCD-to-Seven-Segment Decoders/Drivers datasheet - TI.com
    PRODUCTION DATA information is current as of publication date. Products conform to specifications per the terms of Texas Instruments standard warranty.
  58. [58]
    Hardware Architecture of Texas Instruments' Electronic Calculators
    An IC-based, battery-powered "miniature calculator" that could add, subtract, multiply and divide, yet could fit in the palm of the hand.
  59. [59]
    [PDF] DIGITAL DATA PROCESSOR
    The printer being used requires the decimal input to be in the form of a BCD (Binary Coded Decimal) number. A BCD number requires four input lines per ...
  60. [60]
    An approach to small machine design in large-scale integration
    The decimal output device is either a ,printer or a display. Thus there is ... ,The number scheme is BCD. The. BCD code offered relatively simple ...
  61. [61]
    CD4511 - A BCD to 7-Segment Display Driver Chip
    The CD4511 is a BCD to 7-segment decoder. It converts a binary number from the input and displays this number on a 7-segment display.
  62. [62]
    Digital Lab - 7-segment LED Display - All About Circuits
    In this hands-on electronics experiment, you will control a 7-segment binary-coded decimal (BCD) display and learn about active-low and active-high logic ...
  63. [63]
    Understanding Packed BCD - A.P. Lawrence
    Packed BCD (Binary Coded Decimal) is a numeric format that was directly supported on cpu's almost from the beginning, and still is today.
  64. [64]
    [PDF] CHAPTER TWO
    decimal value. There are two primary advantages of BCD over binary. First, any mathematical operation based on a factor of ten is simpler in BCD.
  65. [65]
    BCD Codes in Digital Electronics - Sanfoundry
    You will explore Binary Coded Decimal (BCD), its conversions, advantages, and disadvantages. ... Arithmetic calculations with BCD number is complex and ...<|separator|>
  66. [66]
    Decimal Versus Binary Representation of Numbers in Computers
    Oct 1, 2022 · Decimal uses 10 digits (base-10), while binary uses 2 (base-2). Computers use binary internally, but use decimal for human interaction.
  67. [67]
    Sign representation of zoned and packed-decimal data - IBM
    Sign representation affects the processing and interaction of zoned decimal and internal decimal data.Missing: Architecture instructions<|control11|><|separator|>
  68. [68]
    [PDF] NP-000073.pdf - 3GPP
    Mar 15, 2000 · TBCD-STRING ::= OCTET STRING. -- This type (Telephony Binary Coded Decimal String) is used to. -- represent several digits from 0 through 9 ...
  69. [69]
    [PDF] GSM 03.40 - ETSI
    This GTS describes the point-to-point Short Message Service (SMS) of the digital cellular telecommunications system (Phase 2/Phase 2+). This GTS is a TC-SMG ...Missing: BCD TBCD
  70. [70]
    Specification # 29.002 - 3GPP
    29.002. Title: Mobile Application Part (MAP) specification. Status: Under change control. Type: Technical specification (TS). Initial planned Release: Release ...
  71. [71]
  72. [72]
    [PDF] Common Channel Signalling System No. 7 (SS7)
    Each digit of the number is coded as 4- bit BCD codes. The calling party's category IE is a one octet IE that contains information about, (a) the language ...Missing: Binary- decimal TBCD
  73. [73]
    [PDF] Output Specification
    TBCD-STRING ::= OCTET STRING. -- This type (Telephony Binary Coded Decimal String) is used to. -- represent several digits from 0 through 9, *, #, a, b, c ...
  74. [74]
    Q.931 : ISDN user-network interface layer 3 specification for basic call control
    ### Summary: Encoding of Calling and Called Party Numbers in Q.931
  75. [75]
    Decimal instructions - IBM
    Hardware packed-decimal instructions are available to C/C++ programs in the form of built-in functions. These hardware built-in functions are intended to ...Missing: System/ 360 BCD documentation
  76. [76]
    Did many programs really store years as two characters (Y2K bug)?
    Jun 20, 2020 · For one rather large mainframe application we solved the Y2K problem without extending records, but by extending the BCD range. So the next ...Missing: legacy | Show results with:legacy
  77. [77]
    Introduction to ISO 8583 - CodeProject
    Aug 8, 2010 · Packed BCD reduces the amount of time spent transmitting the numbers, as each data byte transmitted results in the sending of two BCD digits.
  78. [78]
    Avoiding problems with packed-decimal fields - IBM
    COMPUTATIONAL-3 fields (packed-decimal format) are often defined as having an odd number of digits even if the field will not be used to hold a number of that ...
  79. [79]
    Break the Telecom Legacy Billing System Ball and Chain - Intellyx
    Oct 15, 2025 · Yet many telecommunication companies lag behind the industry and still use legacy billing systems that are inflexible, difficult to change, and ...
  80. [80]
    EP1231716A2 - Decimal to binary coder/decoder - Google Patents
    The coding is based on representing 3 decimal digits as 10 binary bits and is a development of the Chen-Ho algorithm. This provides a storage efficiency of > 99 ...Missing: Han | Show results with:Han
  81. [81]
    Densely packed decimal encoding for IEE Proceedings
    May 1, 2002 · Chen-Ho encoding is a lossless compression of three binary coded decimal digits into 10 bits using an algorithm which can be applied or ...Missing: BCD 2000
  82. [82]
    Decimal types | Comdb2 Documentation
    decimal32 supports exponents between -95 and +96; significand has 7 digits (i.e. 0.000000-9.999999). The range of numbers representable by this format is +- ...
  83. [83]
    [PDF] Decimal Arithmetic Encodings - speleotrove.com
    Mar 20, 2009 · In the encoding of these dual-integer numbers, the sign is a single bit, as for IEEE 754 binary numbers. The exponent is encoded as an unsigned ...
  84. [84]
    A study of decimal left shifters for binary numbers - ScienceDirect.com
    IEEE 754-2008 specifies two encodings for DFP significands; (1) a binary encoding, known as Binary Integer Decimal (BID), and (2) a decimal encoding, known as ...
  85. [85]
    Gray Code Basics - Technical Articles - All About Circuits
    Jan 9, 2016 · A Gray Code is a binary encoding where only one bit changes between numbers, used for error detection and in encoders.