# Conventions for form of graycode values in programming?

**URL:** <https://boards.straightdope.com/t/conventions-for-form-of-graycode-values-in-programming/480959>\
**Category:** Factual Questions\
**Created:** [January 12, 2009, 7:08pm UTC](https://boards.straightdope.com/t/conventions-for-form-of-graycode-values-in-programming/480959 "2009-01-12T19:08:02Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [January 15, 2009, 7:21am UTC](https://boards.straightdope.com/t/conventions-for-form-of-graycode-values-in-programming/480959/21 "2009-01-15T07:21:43Z")

</div>

BCD makes more sense when you know it stands for ‘Binary-Coded Decimal’: Each decimal digit (0-9) is encoded into 4 bits (a nybble). This was invented because it’s easier to store and sort numbers in BCD form when you have to build a special circuit, as opposed to relying on a microprocessor; historically, this was associated with punch card data and processing, as cards would be automatically sorted by specialized hardware as opposed to wasting extremely expensive computer time on such a task.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [January 16, 2009, 10:41pm UTC](https://boards.straightdope.com/t/conventions-for-form-of-graycode-values-in-programming/480959/22 "2009-01-16T22:41:59Z")

</div>

I’ve used BCD a few times as an interface between instruments and computers. Advantageously, it is pretty easy to make the computer and the instrument display agree without doing any kind of handshaking or processing. Beats having people call about why there is some kind of difference between the two.

But I haven’t used it in a few years.

[Previous page](https://boards.straightdope.com/t/conventions-for-form-of-graycode-values-in-programming/480959.md?page=1)
