Www.quia.com



EMMA HS1 Outline Week #3

Review Homework

Video - Binary

Binary Digits (Bits)

Decimal

Binary

Bits, Nibbles, Bytes, Words

Kilobytes, Megabytes, Gigabytes

Hexadecimal

ASCII

Computer Number Conversions

Number One Rule - Write out the place value tables first

Binary Conversions – Using Base 2 Place Values

Binary to Decimal Conversion

Multiply by 2 to the X Power

Decimal to Binary Conversion

Divide by 2 to the X Power

Hexadecimal Conversions

Hexadecimal to Decimal Conversion

Multiply by 16 to the X Power

Decimal to Hexadecimal Conversion

Divide by 16 to the X Power

Use the Table

Hexadecimal to ASCII Conversion

Table Conversion

Decimal to ASCII Conversion

Table Conversion

Homework - Numbering Systems Used By Computers Quiz (Online)

DOCS Online - Numbering Systems Used By Computers

Big List of Computer Memory Terms

Computer Numbering Systems

NUMBERING SYSTEMS USED BY COMPUTERS

A. Lesson Objective

To learn the basics of what a numbering system is and to understand how to use and work with the two special numbering systems used by computers.

B. Lesson Glossary

Number: The word number comes from the Latin word numerare which means to count. The quantity of anything counted and the form in which that quantity is expressed would be called a number. Twenty-five is a quantity and when expressed as a decimal number it appears as 25.

Decimal Number: The word decimal comes from the Latin word decem which means ten. When humans first started counting they probably had to use their fingers and toes to do it. As there are ten fingers all told on both hands it has become natural to think in quantities or numbers that are one or more multiples of ten. A number is made up of digits (Latin for finger or toe.) There are ten digits in a decimal system and they are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. When we express twenty-five as a decimal number we use the digits 2 and 5 which then appears as 25.

Binary Number: The word binary comes from the Latin word binaries, which means two or double. A binary number consists of only two digits and they are 0 and 1. A binary digit is also known as a bit. Some examples of binary numbers are 0001 or 1011 or 1111. You should read these as zeroes and ones. The number 0001 should be read as zero-zero-zero-one. You will learn to calculate the values of these numbers later in this lesson.

Hexadecimal Number: The word hexadecimal is made up of two separate words that have been joined to make one word. Hexa comes from the Greek word hex, which means six, and decimal means ten. A hexadecimal number is made up of six plus ten = sixteen digits. The first ten digits are from the decimal system (0 through 9) and the remaining six digits use the letters A, B, C, D, E, and F. In this A = ten, B = eleven, C = twelve, D = thirteen, E = fourteen, and F = fifteen. Some hexadecimal numbers are: 01F, A04, 193. The number should be read as individual digits so you should read 193 as one-nine-three. You will learn to calculate the values of these numbers later in this lesson.

Base: This is the lowest part on which something rests. When referring to a numbering system the base refers to the number of digits that make up that numbering system. A decimal number has a base of 10. A binary number has a base of 2 and a hexadecimal number has a base of 16.

Exponent: This is an expression of the number of times that another number is to be multiplied by itself. For example, an exponent of 3 when applied to the number 10 is the same as saying 10 x 10 x 10. An exponent is show as a little number towards the top and to the right of the number to be multiplied by itself. The previous example is shown as 103.

C. Reading: How Does a Numbering System Work?

It is important to understand the fundamentals of how we work with numbers to express quantities and values. All of us should know by now how to add using the decimal numbering system. At school we are taught to count to one hundred and more. We learn that twenty-three is less than thirty-three, that fifty-five is followed by fifty-six, and so on. We also learn what these decimal numbers look like (23, 33, 55, 56). We learn to add, subtract, multiply, and divide and so become very familiar with these numbers. Fortunately, all of the rules that we learned apply equally well to any other numbering system such as the binary system or the hexadecimal system.

One of the first obstacles to overcome is the compulsion to see numbers as only decimal numbers. In other words, when you see 101 written down you automatically think of it as being one hundred one. However, 101 in a binary system has the value of five and in the hexadecimal system it has the value of two hundred fifty-seven. That is why you have to first of all establish the numbering system being used to show the value or quantity. To help you with this, a letter is often placed at the end of the number when it is not obvious what kind of number is being used. The letter b is used for binary and the letter h is used for hexadecimal. When you see 101b you know it is a binary number and when you see 101h you know that it is a hexadecimal number.

Another obstacle, or source of confusion, is that a quantity is only meaningful to us when we think of it as a decimal number. Even when you see the number 101b and know that it is a binary number it is still difficult to think in those terms. As a result we have a constant need to translate 101b to a value that we do understand, which in this case is five (5). Now the binary number has meaning and we can think with it. As one becomes more familiar with the binary system through the action of working with it, the need to translate everything back to decimal becomes less and less. You look at a binary number and you just know what it is and what it means. The same is true for the hexadecimal system. Learning to speak a foreign language is much the same thing.

What happens when we run out of fingers and toes?

I am sure that when you first leaned to count or add using the fingers on your hands you had the problem of what to do when you ran out of fingers! There are many different solutions you could apply to that problem. If you had colored beads as well as your fingers you might use them to count, for example, the number of people in a room. As soon as you counted 10 people and ran out of fingers, you could take a blue bead out of your pocket and put it aside. Then you would start using your fingers again and as soon as you ran out of fingers again you would pull out another blue bead and put it aside, so on and so on. Let us suppose you only had 10 blue beads in your pocket and then some red beads, what them? You could replace the 10 blue beads with one red bead and you could then continue to use blue beads every time you ran out of fingers on your hands. When the counting was done you would then only have to look at the number of fingers used on your hands and the number of blue beads and red beads that you had set aside to know how many people were in the room. Let’s say you had 4 fingers up and had put aside 5 blue beads and 1 red bead. How many people would this be?

By arranging your beads as follows:

red beads blue beads fingers

r bbbbb ffff where r = red bead, b = blue bead, f =finger

Then counting the beads with your fingers and writing down the number below each you would see:

red beads blue beads fingers

r bbbbb ffff

1 5 4 = 154 fingers were used, so that is how many

people were in the room

By arranging the beads in order of their number value, you can immediately see a number that communicates and makes sense.

red bead = 100 (10 x 10 blue beads = 100 fingers)

blue bead = 10 (10 fingers)

finger = 1 (1 finger)

From the above you can see that the position of a digit in a number determines what value it has. In a number with three digits (154) the first digit (1) has a higher value than the second digit (5). The second digit (5) has a higher value than the third digit (4).

Expressing the value of a digit based on its position in the number

When working with a number the firs thing to establish is its base. When the decimal system is being used the base is 10.

The next thing to establish is the value of each position in a number. The 1st digit in a number has a higher value than the 2nd digit and it has a higher value than the 3rd. The 1st digit is called the high-order digit. The last digit is called the low-order digit. The value of a position in the number gets higher as one moves from the low-order digit towards the high-order digit. The low-order digit is in position 0. The next digit to the left is position 1, the next one to the left of that is position 2, and so on. For example, in the number 5,684:

|Number |5 |6 |8 |4 |

|Position |3 |2 |1 |0 |

Now, by using the position of the number as an exponent with a base of 10, the value of a position in a decimal number can be determined.

|Position |Exponent base 10 |Calculation |Position Value |

|0 |100 |1 |1 |

|1 |101 |10 |10 |

|2 |102 |10x10 |100 |

|3 |103 |10x10x10 |1000 |

|4 |104 |10x10x10x10 |10,000 |

With the value of a position in a number established, it is now possible to find out what the value of a number is. Using our earlier table and the number 5,684:

|Position |Exp. base 10 |Calculation |Position Value |Digit |Digit Value |

|0 |100 |1 |1 |4 |4 |

|1 |101 |10 |10 |8 |80 |

|2 |102 |10x10 |100 |6 |600 |

|3 |103 |10x10x10 |1000 |5 |5,000 |

|4 |104 |10x10x10x10 |10,000 | | |

| | | | |Total |5,684 |

You can see that the digit value is found by multiplying the digit times the position value. The total value of the number is found by adding the values of each of the digits together.

D. Reading: How Does the Binary Numbering System Work?

As you will have leaned from the definitions, a binary number is made up of only 2 digits and they are 0 and 1. The base of the binary system is 2. Below is a table showing binary numbers and their decimal values.

|Binary |Decimal Value |Binary |Decimal Value |Binary |Decimal Value |

|000000 |0 |000110 |6 |001100 |12 |

|000001 |1 |000111 |7 |001101 |13 |

|000010 |2 |001000 |8 |001110 |14 |

|000011 |3 |001001 |9 |001111 |15 |

|000100 |4 |001010 |10 |010000 |16 |

|000101 |5 |001011 |11 |010001 |17 |

But how can the value for a binary number be calculated? the same way that a value is calculated in the decimal system.

|Position |Exponent base 2 |Calculation |Position Value |

|0 |20 |1 |1 |

|1 |21 |2 |2 |

|2 |22 |2x2 |4 |

|3 |23 |2x2x2 |8 |

|4 |24 |2x2x2x2 |16 |

The position of a digit in a binary number determines

its value. Using the position of the number as an exponent with a base of 2, the value of each position can be worked out as follows:

Having established the value of a position in a binary number, the decimal value of a binary number can be calculated. For the binary number 1101 it would be the value 13.

|Position |Exp. base 2 |Calculation |Position Value |Binary Digit |Digit Value |

|0 |20 |1 |1 |1 |1 |

|1 |21 |2 |2 |0 |0 |

|2 |22 |2x2 |4 |1 |4 |

|3 |23 |2x2x2 |8 |1 |8 |

|4 |24 |2x2x2x2 |16 | | |

| | | | |Total Value |13 |

You can see that the digit value is determined by multiplying the binary digit by its position value. The value of the binary number is found by adding the digit values together.

Adding two binary numbers:

0 + 0 = 0

1 + 0 = 1

0 + 1 = 1

1 + 1 = 0 carry 1 to the next higher position

therefore:

binary decimal

1101 = 13 (as seen earlier)

101 = 5

_____ ___

|Binary Number |1 |0 |0 |1 |0 |

|Position |4 |3 |2 |1 |0 |

10010 = 18

Verifying this:

1 x 24 = 1 x 16 = 16

1 x 21 = 1 x 2 = 2

____

18 = eighteen

E. Reading: How Does the Hexadecimal System Work?

As you saw from the definitions, a hexadecimal number is made up of 16 digits, which are represented by 0-9 and A-F. The base of the hexadecimal system is 16. Below is a table showing some hexadecimal numbers and their decimal values.

|Hex |Decimal |Hex |Decimal |

|0 |160 |1 |1 |

|1 |161 |16 |16 |

|2 |162 |16x16 |256 |

|3 |163 |16x16x16 |4096 |

|4 |164 |16x16x16x16 |65,536 |

|Position |Exp. base 16 |Calculation |Position Value |Hex Digit |Digit Value |

|0 |160 |1 |1 |3 |3 |

|1 |161 |16 |16 |F |240 |

|2 |162 |16x16 |256 |A |2.560 |

|3 |163 |16x16x16 |4,096 |1 |4,096 |

|4 |164 |16x16x16x16 |65,536 | | |

| | | | |Total Value |6,899 |

Having established the value of a position in a hexadecimal number, the total value of a hexadecimal value can now be calculated. For the hexadecimal number 1AF3 it would be 6,899.

Adding two hexadecimal numbers:

1A4

27C

420

Explanation: 4 + C: this is 4 + 12 = 16; this in hex is 10; write down 0 and carry 1 to the next highest position

A + 7 + 1: this is 10 + 7 + 1 = 18; this in hex is 12; write down 2 and carry 1 to the next highest position

1 + 2 + 1: this is 4; write down 4

F. Reading: Comparing Binary, Hexadecimal and Decimal Numbers

binary (base 2) hexadecimal (base 16) decimal (base 10)

20 = 1 160 = 1 100 = 1

21 = 2 161 = 16 101 = 10

22 = 4 162 = 256 102 = 100

23 = 8 163 = 4,096 103 = 1,000

24 = 16 164 = 65,536 104 = 10,000

25 = 32 165 = 1,048,576 105 = 100,000

26 = 64 166 = 16,777,216 106= 1,000,000

27 = 128 167 = 268,435,456 107 = 10,000,000

28 = 256 168 = 4,294,967,296 108 = 100,000,000

G. Reading: Why Do Computers Use Binary and Hexadecimal Numbering Systems?

Just as the decimal system is natural to humans, the binary system is more natural to electronic devices and magnetic memory. Computers and electronic circuits easily work with 2-state logic (true/false, on/off, or 0/1). How a computer ‘remembers’ data has a lot to do with how a computer works. Early computer memory was made up of ferrite rings (pure metallic iron with a high magnetic sensitivity) that had three wires going through them. With current moving through two of these wires at the same time, it was possible to either magnetize (turn on) or demagnetize (turn off) the ring. The third wire was a sensor wire that was able to detect whether the ring was magnetized or not. In this way it was possible for a computer to record and to ‘remember’ or ‘recall’ data.

In a computer, the smallest piece of data is the bit, which has a value of 0 or 1. The next smallest grouping of data is called a byte and that is made up of 8 bits. As you saw earlier in this lesson the maximum number of different combinations of 0 and 1 that can be stored in a byte are 28 which comes to 256. It starts as 00000000 and ends as 11111111, which is equal to 255.

If a computer works in binary, then what is the hexadecimal system used for?

The answer to this question has to do with the way that binary data is presented or made visible to humans. If you wanted to see the contents of 4 bytes of data it could be displayed in binary format as follows:

|Byte 1 |Byte 2 |Byte 3 |Byte 4 |

|11001011 |01100111 |000001100 |11101010 |

This takes up a lot of space and is difficult to read.

It could be presented as a decimal number and it would appear as:

|Byte 1 |Byte 2 |Byte 3 |Byte 4 |

|203 |103 |6 |234 |

This takes up less space, but if you wanted to change these numbers back to binary numbers this would not be easy to do. In fact, you would have to convert them to hexadecimal first.

However, if this data was presented in hexadecimal format it would appear as

|Byte 1 |Byte 2 |Byte 3 |Byte 4 |

|CB |67 |06 |EA |

This shows us that a byte of data can be represented by 2 hexadecimal digits. So, 4 bytes of data are represented by 8 hexadecimal digits. What can also be done easily is translating these hexadecimal numbers back into binary numbers by using the following conversion table:

0 = 0000 4 = 0100 8 = 1000 C = 1100

1 = 0001 5 = 0101 9 = 1001 D = 1101

2 = 0010 6 = 0110 A = 1010 E = 1110

3 = 0011 7 = 0111 B = 1011 F = 1111

|C |B |6 |7 |0 |6 |E |A |

|1100 |1011 |0110 |0111 |0000 |0110 |1110 |1010 |

|11001011 |01100111 |00000110 |11101010 |

The bottom row of the above table shows the original binary data that was converted to hexadecimal.

Why the easy translation? If you look at the above table, you can see that the maximum value that can be stored in four bits is 1111 and this is equal to the last digit in a hexadecimal number which is F which is equal to decimal 15. By breaking a byte (8 bits) into two groups of 4 bits we are able to easily translate the bits into a hexadecimal digit and vice-versa.

Because of this easy translation, contents of computer memory are normally shown in this format:

memory

location |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |A |B |C |D |E |F | |000h |FA |33 |C0 |8E |D0 |BC |00 |7C |8B |F4 |50 |07 |50 |1F |FB |FC | |010h |BF |00 |06 |B9 |00 |01 |F2 |A5 |EA |1D |06 |00 |00 |BE |BE |07 | |020h |B3 |04 |80 |3C |80 |74 |0E |80 |3C |00 |75 |1C |83 |C6 |10 |FE | |030h |CB |75 |EF |CD |18 |8B |14 |8B |4C |02 |8B |EE |83 |C6 |10 |FE | |

Memory location 13h contains the value B9. Memory location 34h contains the value 18h.

As covered in lesson 2, the significance of ANY value in computer memory depends on data structure.

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download