Computer Technology 3200

Architecture

What is Architecture Bits & Bytes How it works Processors Memories I/O communications

SECTION 2: BITS, BYTES, WORDS AND CODES

WHAT IS THE BASIC BUILDING BLOCK OF A COMPUTER?

The basic building block of any computer is a switch. These switches can be turned either on or off by an electrical current and can maintain their state until another signal changes it.  In computers a switch represents either 0 (off) or 1 (on). A 1 or a 0 represented by a switch is called a BIT or Binary Digit.   Thus the basic physical building block is a switch and the basic logical building block is a BIT.

WHAT IS THE DIFFERENCE BETWEEN DIGITAL AND ANALOG ELECTRONICS?

In digital devices such as computers switches are either on or off. Currents either flow or they do not. The size of the current is not important as long as it is within the range which operates the switches properly. Such circuits are called DIGITAL. In analog circuits the strength of the current is important. The loudness of a speaker in your radio is controlled by the size of the current and in theory at least can be controlled continuously over a set range by a rotary volume control. Such a device is referred to as analog.

WHAT ARE BYTES?

Bits are arranged in groups. A group of eight bits is called a BYTE. By rearranging the sequence of bits in a byte 256 different sequences are possible. Thus a byte can contain codes for 256 different things. The code that is most accepted by computer designers to represent the letters and symbols we communicate with is the ASCII code or American Standard Code for Information Interchange. In this code a byte or 8 bits represents one character. The ASCII code is used to represent symbols but other codes are used to represent instructions, and numbers inside the computer.

HOW DOES A BYTE REPRESENT A CHARACTER?

Tables of ASCII codes are available in most programming books. Here's how it works...

HOW ARE BINARY AND DECIMAL NUMBERS CONVERTED?

The short answer is by a computer but it is instructive to try a couple of conversions by hand. Let's count in binary...

BINARY DECIMAL
0000 0000 0
0000 0001 1
0000 0010 2
0000 0011 3
0000 0100 4
0000 0101 5

Note that if a byte contains a single 1 bit it is a power of 2.i.e. 0000 0001 = 20; 0000 0010 = 21 0000 0100 = 23 and so on...Thus the bits in a byte represent successive powers of 2.

1111 1111 = 27 + 26 + 25 + 24 + 23 + 22 + 21 + 20

or 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

We can make use of this to do our conversions.

EXAMPLE: Convert 177 decimal to binary.

A. Write down the eight powers of 2 and put a line under each.

128 64 32 16 8 4 2 1

B. Put a 1 under the largest number less than or equal to 177.

128  64  32  16  8  4  2  1

  1                                   

C. Subtract that number from the original.

177-128 = 49

D. Repeat steps B and C for the remaining number until it becomes 0.

128  64  32  16   8   4   2   1

  1          1     1                 1

E. Fill the remaining blanks with 0's. The binary number in the blanks is equal to the original number.

1011 00012 = 17710

EXAMPLE: Convert 1001 1101 into decimal.

A. Repeat step A above.

B. Place the binary number in the blanks.

C. Multiply each column and add the result across the row to get the decimal number.

128   64   32   16   8   4   2   1

  1     0    0    1   1   1  0   1

128 +0 +0 +16+8 +4 +0 +1 = 157

WHAT IS HEXADECIMAL AND WHY IS IT USED?

Notice that when writing bytes we often arrange them in groups of four or NYBBLES to make them more readable. The maximum number that can be represented by a nybble is 15 so 16 things can be represented by a nybble. The hexadecimal system is based on the number 16. The digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, AND F. Thus you can represent all the numbers in a nybble by a single digit. This makes converting binary into hexadecimal much easier than converting into decimal. For example the nybble 1110 is E. The byte 1110 0011 is E3. Since the memory of a standard Personal Computer (PC) can often contain a megabyte or over a million locations, it is easier to translate memory locations and contents into hex than decimal notation.

Decimal Binary Hexadecimal   Decimal Binary Hexadecimal
0 0000 0   8 1000 8
1 0001 1   9 1001 9
2 0010 2   10 1010 A
3 0011 3   11 1011 B
4 0100 4   12 1100 C
5 0101 5   13 1101 D
6 0110 6   14 1110 E
7 0111 7   15 1111 F


WHAT IS A KILOBYTE AND A MEGABYTE?

If we continue in our binary numbers past one byte we soon come to a number containing 10 bits. This number 11 1111 1111 is 1023 in decimal notation. Since this is close to 1000 it is referred to as kilo. 1024 bytes is called a kilobyte (KB).

A megabyte (MB) or 1024 x 1024 = 1,048,576 bytes is called a megabyte. These terms generally refer to the number of bytes or characters that can be stored in memory or on disk. Note the difference between KB and Kb. Kb means Kilobit and is a term often used to refer to the capacity of memory chips.

WHAT IS A WORD?

The first microcomputers such as the Commodore-64 transferred data 1 byte at a time along 8 parallel lines called an 8 bit bus. Newer computers often transfer 2 or even 4 bytes at a time along 16 or 32 bit buses. This is referred to as the word size of the computer. Increasing the word size from a single byte to 2 or even 4 bytes increases the speed of data transfer between memory and processor within the computer. By the way, the 64 refers to the fact that the C-64 had 64 KB of RAM.


Hello Class

Below you will find links to your particular review work on this section.  Please have it for class tomorrow.

Brad
Lance
Robby
Mike
Joey
Nichole
Martin
Blake