After completing these activities you should be able to:
Cyberspace is a name for this global information system consisting of many familiar pieces — like websites, distributed video games, email — and many less familiar pieces as well, that work behind the scenes. Recall that we used the Department of Defense Joint Publication 3-12 on Joint Cyberspace Operations (JP 3-12) for defining cyberspace as
"a global domain within the information environment consisting of the interdependent networks of information technology infrastructures and resident data, including the Internet, telecommunications networks, computer systems, and embedded processors and controllers."
The fundamental aspect of all of these interconnected systems process, store, and access digital data. As electric current passes through the system bus and between hardware components, its signal and timing serve as the foundation of binary representation as 1's and 0's. Depending on your major, courses like Electrical Engineering or Computer Engineering will get deep into electronic signaling and how the amount of voltage is controlled and processed to support computer architectures. Fortunately, we will only be discussing basic mathematical principles of what those signals represent and how computers process data at a conceptual level.
The most common numeral system on the planet is the base 10 (N10) system, where each value increments by one and each additional number represents 10n. Two Thousand Forty Eight is represented as (2 * (103)) + (0 * (102)) + (4 * (101)) + (8 * (100)). Notice that the least significant (e.g., smallest) value is always on the right. That rule will continue to be applied to all of the numeric systems used in this course.
Another great example of a base 10 system is roman numerals, where I represent 1, V=5 or ½(101), X=10, L=50, D=500, M=1000, and so forth. We're used to working with base 10, but this class will introduce you to two of the most common numeric systems used across computing, base 2 and base 16.
Binary values represent two states, 1 and 0, on and off. Each value represents a binary digit or bit (b), which is a combination of the two words. Using the base 2 (N2) system, each position increments exponentially, as is the case with base 10 systems, but requires more positions. In converting the previous decimal value of Two Thousand Forty Eight to binary, it is written as 100000000000. Let's break it down:
| ← MSB | LSB → | |||||||||||
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| N2 | 211 | 210 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
| N10 | 2048 | 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Let's compare the decimal number One Hundred Twenty Three using base 10 and base 2 numeric systems:
| 1 | 2 | 3 | ||
| 102 | 101 | 100 | ||
| N10 | 100 | 10 | 1 | |
| SUM | 100 + | 20 + | 3 = | 123 |
| ← MSB | LSB → | ||||||||
| 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | ||
| N2 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | |
| N10 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
| SUM | 0 + | 64 + | 32 + | 16 + | 8 + | 0 + | 2 + | 1 = | 123 |
Recall from algebra that multiplication is a form of addition and division is a form of subtraction. The latter applies when converting base 10 to base 2 but we'll elaborate on the two different techniques available for use. The first technique in binary conversion is subtracting the decimal value from the binary value, starting with the MSB and working down to zero.
Solve for the binary value of decimal 123 using the subtraction method:
| ← MSB | LSB → | ||||||||
| N2 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | |
| N10 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
| Solve | 123 | 123-64 | 59-32 | 27-16 | 11-8 | 3 | 3-2 | 1-1 | |
| Remainder | 123 | 59 | 27 | 11 | 3 | 3 | 1 | 0 | |
| Binary | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 |
| ← MSB | LSB → | |||||||
| Dividend | 0 | 1 | 3 | 7 | 15 | 30 | 61 | 123 |
| Solve | 0 | 1÷2 | 3÷2 | 7÷2 | 15÷2 | 30÷2 | 61÷2 | 123÷2 |
| Quotient | 0 | 0 | 1 | 3 | 7 | 15 | 30 | 61 |
| Remainder | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 |
| ← MSB | LSB → | ||||||||
| Binary | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | |
| N2 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | |
| N10 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
| SUM | 0 + | 64 + | 32 + | 16 + | 8 + | 0 + | 2 + | 1 = | 123 |
A computer is typically capable of storing and processing an immense amount of data. In order to scale, just like we do with base 10 values, prefixes are used to represent large numbers. Below are charts representing both base 10 and base 2 values used in computing. When referring to storage, data is typically referred to in bytes (B), where 20 Gigabytes (GB) is equivalent to 20,000,000,000 bytes; however, note that the International Electrotechnical Commission (IEC) standardized prefix for base 2 would be identified as 20 Gibibytes (GiB) with an accurate decimal value of 21,474,836,480 bytes. That's a difference of 1,474,836,480 bytes when comparing 20GB to 20GiB.
| Prefix | Symbol | Base 10 | Number of Bytes (Decimal) |
|---|---|---|---|
| kilo | K | 103 | 1,000 |
| mega | M | 106 | 1,000,000 |
| giga | G | 109 | 1,000,000,000 |
| tera | T | 1012 | 1,000,000,000,000 |
| peta | P | 1015 | 1,000,000,000,000,000 |
| exa | E | 1018 | 1,000,000,000,000,000,000 |
| zetta | Z | 1021 | 1,000,000,000,000,000,000,000 |
| Prefix | Symbol | Base 2 | Number of Bytes (Decimal) |
|---|---|---|---|
| kibi | Ki | 210 | 1,024 |
| mebi | Mi | 220 | 1,048,576 |
| gibi | Gi | 230 | 1,073,741,824 |
| tebi | Ti | 240 | 1,099,511,627,776 |
| pebi | Pi | 250 | 1,125,899,906,842,624 |
| exbi | Ei | 260 | 1,152,921,504,606,846,976 |
| zebi | Zi | 270 | 1,180,591,620,717,411,303,424 |
Bytes are a foundational principle in computing but it can be cumbersome to write out all eight bits of a byte. To simplify the amount of data that can be viewable by humans, each byte is displayed as two hexadecimal digits, or nibbles (yes, it's a play on words from byte). Hexadecimal is base 16 (N16) number system. The important point is that it gives us a concise representation for bytes since each hex digit represents a 4-bit pattern. Two hex-digits represent an 8-bit pattern, or one byte. But what happens beyond decimal values of 0-9? Just like license plates, letters allow combinations of numeric representations beyond ten digits with 10=a, 11=b, 12=c, and so on.
The following table gives the mapping between the hex, 4-bit nibbles, and decimal values:
| hex digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f |
| 4-bit nibble | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
| decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| Bin | 0 | 1 | 1 | 1 | : | 1 | 0 | 1 | 1 |
| N2 | 23 | 22 | 21 | 20 | : | 23 | 22 | 21 | 20 |
| SUM | 0 + | 4 + | 2 + | 1 | : | 8 + | 0 + | 2 + | 1 |
| Dec | 7 | : | 11 |
| Hex | 7 | : | B |
| N16 | 161 | 160 |
When converting N2 to N16, always begin with nibbles from the LSB. This is because leading zeros that would typically complete a full byte may not exist. Earlier discussions stated that 111 binary is equivalent to 7 decimal and so was 00111 binary. Let's use a larger value to convert for hex, such as 10100 whose decimal value is 20.
Based on the earlier statement in regards to leading zeros,
if
20 (dec) = 020 (dec)
and
20 (dec) = 10100 (bin),
then
10100 = 010100 = 00010100 (leading zeros).
Converting 10100 to hex = 0x14 when starting with LSB.
What happens if 010100 is converted to hex from the MSB? Then 010100 or 0101 0000 (trailing zeros) would be 0x50 but 0x50 ≠ 20 (dec)! 0x50 = 80 (dec) = 1010000 (bin). Never start converting hex or nibbles from the MSB!
When separating bin values into nibbles, it becomes much easier to read.
In restating the previous conversions with nibble separation,
if
20 (dec) = 020 (dec)
and
20 (dec) = 1 0100 (bin),
then
1 0100 = 01 0100 = 0001 0100.
Similarly with dec values, we separate every N10 exponent multiple of 3 with commas to make it easier to read. Now you can see that you must begin with the LSB to ensure that the proper nibble values are aligned!
Other than numbers, the most fundamental form of data is plaintext. The method for representing text digitally (i.e. as bits and bytes) depends on the alphabet of languages. In cyberspace, English uses the American Standard Code for Information Interchange (ASCII) based on standardized telegraph code from the early 1960's. Each ASCII character is represented using one byte (i.e. one number in the range 0-255, although in reality we only use 0-127), where the characters allowed and the byte values (i.e. numbers) they correspond to are given by the ASCII Table.
So, for example, the ACII letter a has a decimal value of 97 which is byte 0110 0001 (spaced for readability). ASCII values 32-126 are the printable characters and any sequence of bytes consisting solely of them is considered to be plaintext. We might allow the additional values 9 ← tab, 10 ← newline, 13 ← carriage return, which provide limited formatting. The standard QWERTY keyboards have a 104-key configuration but, for all of the gamers and coders, there can be 115-key layouts to customize shortcuts and add key sequences.
% before the hex value. For example, the ASCII Character a has a hex value of 61, so a a can be written in the address bar as %61. Thus, entering usn%61.edu in your browser's address bar gets you to usna.edu! Certain browsers may no longer permit these actions as there are negative security implications.
A sequence of characters is called a string, and what we've just seen is that ASCII gives us a way to encode strings as sequences of bits (or, if you prefer, bytes).