Search for a tool
Binary Coded Decimal (BCD)

Tools to code/decode in BCD (binary coded decimal) a numeration system used in electronics and computer systems to code decimal numbers on 4 bits.

Results

Binary Coded Decimal (BCD) -

Tag(s) : Electronics

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our community Discord for help requests!


Thanks to your feedback and relevant comments, dCode has developped the best 'Binary Coded Decimal (BCD)' tool, so feel free to write! Thank you !

Binary Coded Decimal (BCD)

Sponsored ads

BCD Decoder/Converter



DBC Encoder/Converter







Tools to code/decode in BCD (binary coded decimal) a numeration system used in electronics and computer systems to code decimal numbers on 4 bits.

Answers to Questions

How to encrypt using BCD coding

BCD (binary coded decimal) encoding replaces directly digits 0, 1, 2, ..., 9 by their binary values (with 4 bits)

00000
10001
20010
30011
40100
50101
60110
70111
81000
91001

Example: To code 123, replace 1 by 0001, 2 by 0010 and 3 by 0011, so 123 is coded 0001,0010,0011 in BCD

In computers, storage is done on 8 bits, and to store BCD 4 bits on 1 byte (8 bits) is done by filling with 0 or 1 (recommended) at the beginning (storage called extended BCD, used in particular by EBCDIC)

Example: The storage of 123 in extended BCD is 11110001 11110010 11110011 (completed with 1111 at the start of the byte)

In order not to lose space, there is the packed BCD which stores 2 4-bit digits on an 8-bit byte. In addition, the condensed BCD uses the 6 unused remaining 4-bit combinations (A, B, C, D, E, F in hexadecimal) to encode the signs + and -

+1010A
-1011B
+1100C
-1101D
+ 1110 E
unsigned 1111 F

Example: The storage of 123 in packed BCD is 00010010 00111100 (completed with + 1100 at the end if the number of digits is odd)

There are several ways to code + and - because several variants of BCD have been proposed by computer manufacturers like IBM or Burroughs.

How to decrypt BCD coding

BCD conversion replaces each 4-bit group (packed BCD, the most common encoding) by its corresponding digit

Example: 0001 0010 0011 is decoded 1,2,3

If the code is extended BCD, the first 4 binary bits of each byte can be ignored.

How to recognize an BCD ciphertext?

The message has a length multiple of 4 and non of the 4-bits group can contain 1111.

How to write a negative number?

Some systems uses 1100 for + and 1101 for -

Example: -5 is then written 1101 0101

How to write a non-integer number?

There are different approaches to writing a non-integer (floating point) number.

The most common method is to use fixed point numbers where the point position is fixed a priori.

Example: It is decided that numbers are stored with 2decimal places (2 digits after the decimal point), then a BCD value 123 will then be read 1.23

Another method is used on some systems that use one of the non-digit values (such as 1100, 1101 or 1110) to store the position of the point.

What is BCD purpose?

BCD is often used in electronics, for storing or displaying numeric values. Conversion is easy, does not need a processor and is similar to peripherals such as 7-segment displays.

Another example is the storing of Dates in a BIOS of a motherboard, still today in BCD.

Also the DECIMAL format of the fields of certain databases can use this BCD coding.

What are BCD values non used in decimal representations?

Unused values are 1010, 1011, 1100, 1101, 1110, 1111

When BCD have been invented?

The first uses of the BCD date from a period between 1950 and 1960

Source code

dCode retains ownership of the online 'Binary Coded Decimal (BCD)' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (PHP, Java, C#, Python, Javascript, Matlab, etc.) no data, script or API access will be for free, same for Binary Coded Decimal (BCD) download for offline use on PC, tablet, iPhone or Android !

Need Help ?

Please, check our community Discord for help requests!

Questions / Comments

Thanks to your feedback and relevant comments, dCode has developped the best 'Binary Coded Decimal (BCD)' tool, so feel free to write! Thank you !


Source : https://www.dcode.fr/binary-coded-decimal
© 2020 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
Feedback