Asked in Computer ProgrammingElectronics Engineering
What is the difference between seven segment display and a binary encoded hexadecimal?
January 20, 2015 7:36PM
A seven segment display allows use to display any decimal value in the range 0 to 9 using just LED 7 segments (or 7 LCD segments). The segments are arranged in a rectangle that is 2 segments high by 1 segment wide with 1 more segment in the middle dividing the rectangle in half. The digits are created as follows:
0 : turn on all segments except the middle segment.
1 : turn on the upper and lower right segments.
2 : turn on all segments except the upper left and lower right segments.
3 : turn on all segments except the upper and lower left segments.
4 : turn on all segments except the lower left and the top and bottom segments.
5 : turn on all segments except the upper right and lower left segments.
6 : turn on all segments except the upper right segments.
7 : turn on the upper and lower right and the top segments.
8 : turn on all segments.
9 : turn on all segments except the lower left segment.
There is no such thing as a binary encoded hexadecimal value. The encoding is simply the representation of a number. E.g., the symbol 42 is not a number, it is merely the representation of a number. Forty-two is an actual number. This is because 42 is only the number forty-two when the digits are base-10 (decimal). In octal notation, 42 is thirty-four and in hexadecimal notation 42 is sixty-six.
Humans use decimal encoding to represent numbers simply because that's the way we were taught from an early age. We consider them easy to work with simply because we consider it easier to work in powers of 10. However, it's really no easier than working in powers of 5 or 12. Before decimalisation became the norm we actually used sexagesimal, base-60, because of its high divisibility (it's the lowest number that has all the factors 2, 3, 4, 5 and 6). Hence there are 60 seconds to the minute, 60 minutes to the hour, 24 hours in the day (2x2x2x3) and 360 degrees in a rotation.
Binary and hexadecimal are simply different ways of encoding the same number. Computers only understand binary, but binary notation is tedious for humans because there are only two symbols to work with. Higher bases allow us to work with numbers more quickly because there are more symbols to play with and therefore more values we can represent with just a single digit. However, any base that is itself a power of two gives us a very simple conversion to and from binary. That is; base-4, base-8 and base-16 are more closely related to binary than is decimal.
For instance, two binary digits have four possible combinations, each of which can be represented by just one base-4 digit. Three binary digits have eight possible combinations each of which can be represented by just one base-8 digit (octal notation). It therefore follows that a single base-16 digit can represent any combination of 4-bits. Since a byte is typically 8-bits in length, a hexadecimal digit is known as nybble because it is half-a-byte.
Knowing this we can easily convert any number from hexadecimal to binary and back again. And if we can do it easily then a computer can do it just as easily. Converting to and from decimal is not so straightforward, but the computer can be programmed to do that for us as well, since decimal is the notation we're more used to. But when we want to instruct the computer in its own language, hexadecimal is easier to work with than decimal.