Computer Science #5: Bytes, Hexadecimal, ASCII

So far we’ve been dealing with minimal bits that can only make simple statements. A circuit that can deal with multiple bits is almost a computer

A group of bits to a computer is a word. These word lengths are described as 6-bit, 8-bit, 24-bit, or any number. Even though bits exist, that’s way too small a unit for practical use, just how we don’t we describe all amounts of money as ‘cents’. In comes the byte which is 8 bits. A byte is the standard unit of digital data. A bit is a cent, a byte is a dollar. There’s also a half-byte called nybble, which is 4 bits, but it isn’t as common as a regular byte; this is the 50 cents of byte.

Since it’s 8 bits, it consists of 8 digits, but not in the decimal number system we’re used to; it’s not the same as an 8-figure number like 10,000,000. A byte can take on binary values from 00000000-11111111, which can represent decimal values from 0-255. 2 bytes would be a byte squared (2562) which jacks that up to 65,536 decimal values.

To recap, we use binary and other alternate number systems to represent values for the computer. Of course for us humans, the decimal ‘0-9’ system works just fine, but for the computer and all the numbers it has to process, that would get extremely messy. I don’t like unnecessarily complicated things either, but over time, you’ll see why we use these alternate number systems.

Bytes use a hexadecimal (base-16) system. 0-9 are still what they are, but after that it goes to letters A-F, which represent decimal 10-15. I know using letters as numbers don’t make this any simpler, but we gotta get used to it. After that, it then goes to hexadecimal 10, which is 16 in decimal. It’ll then finish off those double digits up to 19; hex 11 is dec 17, hex 12 is dec 18… and hex 19 would be dec 25. After that, it goes to hex 1A, which is dec 26, and the pattern continues. So hex digits will go 0-9, A-F, 10-19, 1A-1F, 20-29, 2A-2F, and so on.

If you’ve ever taken a basic graphic design or digital illustration course, you’ve seen hexadecimal used in RGB (red green blue) to represent colors, since all colors have a certain amount of red green blue in them.

For formatting, we write long binary numbers with a space/dash in between every 4 numbers. looking at 00001111 like this is much more antsy then viewing it like 0000 1111.

Computers don’t recognize anything by default. If you want to do something with a thing, you have to first tell it that thing exists. This even applies to plain texts like you’re reading right now. Computers recognize this text through an ASCII code

In Morse code, ‘E’ is a dot, ‘T’ is a dash, but ‘A’ is a dot and dash. Since ‘A’ uses those 2 characters that mean something else by themselves, that makes Morse code a variable bit-length code; it reuses the same characters for different representations.

In the old days, there was a code called Baudot that was used for telegrams. It used dots and spaces like Morse code. Up until the 1960s, there was a new code called ASCII. It can be converted between binary or hexadecimal. As to what the computer reads it as I can’t yet say.

Leave a comment