+ All Categories
Home > Documents > Session Objectives #7

Session Objectives #7

Date post: 23-Feb-2016
Category:
Upload: corina
View: 44 times
Download: 0 times
Share this document with a friend
Description:
Session Objectives #7. Number Systems. Starter Number Puzzle: Find a 10-digit number where the first digit is how many zeros in the number, the second digit is how many 1s in the number etc. until the tenth digit, which is how many 9s in the number . 6210001000. Number Systems. - PowerPoint PPT Presentation
Popular Tags:
14
GCSE Computing#BristolMet Session Objectives#7 Convert numbers in binary, denary and hexadecimal Define the term character set (ASCII) and describe the use of binary numbers to represent characters Explain the use of hexadecimal numbers to represent binary numbers. Explain the relationship between the number of bits per character in a character set and the number of characters which can be represented.
Transcript
Page 1: Session Objectives #7

GCSE Computing#BristolMet

Session Objectives#7

Convert numbers in binary, denary and hexadecimal

Define the term character set (ASCII) and describe the use of binary numbers to represent characters

Explain the use of hexadecimal numbers to represent binary numbers.

Explain the relationship between the number of bits per character in a character set and the number of characters which can be represented.

Page 2: Session Objectives #7

GCSE Computing#BristolMet

Number SystemsStarter Number Puzzle:

Find a 10-digit number where the first digit is how many zeros in the number, the second digit is how many 1s in the number etc. until the tenth digit, which is how many 9s in the number.

6210001000

Page 3: Session Objectives #7

GCSE Computing#BristolMet

Number Systems

We already know that computers like to use 0 and 1 to count due to the fact an electrical charge = 1 and no charge = 0.

This forms the base2 or binary system. Instead of base 10, the decimal system (denary) where you have Units, Tens, Hundreds, Thousands etc, we have use multiples of 2:

128 64 32 16 8 4 2 1 0 1 0 0 1 0 1 1

Using a column diagram like this it is easy to turn denary into binary. In this example, 75 is 1 lot 64, 1 lot 8, 1 lot of 2 and 1 lot 1.

So the denary number 75 expressed in 8 bit binary is 01001011

Page 4: Session Objectives #7

GCSE Computing#BristolMet

Data Representation/Number SystemsTASK

Now express the following denary numbers in 8 bit binary form (commonly known as a byte) and show your working.

a) 13b) 56c) 143

EXTENSION:

Create your own 8 bit binary number and convert to base10.

What is the largest denary number you can create in 8 bit binary? How many decimal values can that represent?...

a) 00001101b) 00111000c) 10001111

Page 5: Session Objectives #7

GCSE Computing#BristolMet

ASCII Character SetThe common QWERTY keyboard is often used for typing text and numbers etc and to enable computers to understand each other a common standard was agreed in the 1960s and the ASCII character set was formed (American Standard Code for Information Interchange).

Key Term: Character set – The characters available to a computer (i.e letters, LETTERS, numbers and punctuation,!~#etc)

127 characters in total are represented by ASCII codes, within the capability of 8 bits (one byte, the amount of storage required for any single character).INVESTIAGTION: SO why use 8 bits per character, why not 7?

ASCII is not appropriate for all circumstances.

HWK – Research the meaning and need for the UNICODE and EBCDIC character sets.

Page 6: Session Objectives #7

GCSE Computing#BristolMet

Position Valued RepresentationPosition valued representation (PVR) is a system to represent any value with a limited number of symbols. Take the decimal system for example, we can represent any value that we need with only 10 symbols (0....9).Examples:100=1......Any number to the 0th power is 1101=10............Any number to the 1th power is that number102=100..........10*10103=1000........10*10*10104=10000......10*10*10*10

With the PVR system there are a number of rules • The number of digits needed for the system is equal to the base. (i.e.

decimal (base 10) has 10 digits)• The value of the largest digit is one less than the base.• The first position to the left of the "base point" is worth 1. (i.e. the decimal

point is the base point of the decimal system.)• Every other position is worth base times the position value to its

immediate right.ow

Page 7: Session Objectives #7

GCSE Computing#BristolMet

OCTAL NUMBER SYSTEM

If binary is a base 2 number system, what would the base be of an octal system?

8In the octal system the column headings are now changed to:

512 64 8 1 and denary 75 is: 0 1 1 3

These larger base systems are needed for computing larger numbers.

TASK: Convert the following denary numbers into octal and remember the PVR rule: The value of the largest digit is one less than the base

a) 263b) 482c) 4095 NB OCTAL IS NOT ON THE GCSE SPECIFICATION

040707427777

Page 8: Session Objectives #7

GCSE Computing#BristolMet

HexadecimalSome information is stored in computers as numbers in base 16. This is called hexadecimal (or hex for short). The principles are the same except that the digits above 9 are represented by capital letters A – F.

TASK: As you can see decimal 10 is A in Hex, so what would the decimal value of hex 10 be?? Discuss...

Binary Hex Decimal Binary Hex Decimal0000 0 0 1000 8 80001 1 1 1001 9 90010 2 2 1010 A 100011 3 3 1011 B 110100 4 4 1100 C 120101 5 5 1101 D 130110 6 6 1110 E 140111 7 7 1111 F 15

Page 9: Session Objectives #7

GCSE Computing#BristolMet

HexadecimalThe column headings in hex (base 16) would now be:

256 16 1And 75 denary will be: 4 lots of 16 and 11 ones or 4B.

TASK: What will the hex value of 126 be?

EXT: What is the base 16 of a) 34 b) 93

TASK: Convert the following hex to base 10 a) 23, b) 3C c) 5F

EXT: TRY SOME MORE

16 goes into 126 7 times with a remainder of 14 (E)Therefore the hexcode is 7E

ANSWERS: a) 35 b) 60 c) 95

ANSWERS: a) 22 b) 5D

Page 10: Session Objectives #7

GCSE Computing#BristolMet

Session Objectives#7

Convert numbers in binary, denary and hexadecimal

Define the term character set (ASCII) and describe the use of binary numbers to represent characters

Explain the use of hexadecimal numbers to represent binary numbers.

Explain the relationship between the number of bits per character in a character set and the number of characters which can be represented.

Page 11: Session Objectives #7

GCSE Computing#BristolMet

Converting Binary & HexadecimalWhy use different number systems??

This is an obvious question since we know computers like the use of binary. Well, the reason is down to the application or use of the computer.

Large binary numbers are difficult to remember and programmers need something easier to recognise. Converting from base 10 to 2 and vice versa can be complex so it is easier to go from base 2 to 16 and vice versa. Since a byte usually has 8 bits, it is easy to split into two 4 bit sections, called nibbles

Key Terms : Byte – 8 bits; Nibble – 4 bits or half a byte

Page 12: Session Objectives #7

GCSE Computing#BristolMet

Converting Binary to Hexadecimal

Denary 45 in binary is 32 + 8 + 4 + 1 or

128 64 32 16 8 4 2 1 0 0 1 0 1 1 0 1

Split into 2 nibbles and treated as 4 bits each:

8 4 2 1 8 4 2 1 0 0 1 0 1 1 0 1

= 2 = 13 = 2DTASK: Using the same method convert a) 11101011 b) 10100011

Now try the reverse, convert to binary a) A5 b) 3B a) EB b) A3

a) 10100101 b)00111011

Page 13: Session Objectives #7

GCSE Computing#BristolMet

The Application of HEX

Why does the 256 (in hex, base 16 to power 2) sound familiar?

Each pixel you see in your display is either Red, Green or Blue (RGB) The light intensity of each is changed from 0 to 255 to determine the colours you see.

That’s a lot of colour choices!

Colour codes are represented in Hex in a set of 6 digits, 2 for Red, 2 for Green and 2 for Blue. What would the codes be like in binary? Why use hexadecimal??

Follow the link to see codes for the various colours and then attempt the quiz

http://www.nameacolor.com/RGB.HTML

Page 14: Session Objectives #7

GCSE Computing#BristolMet

Using hexcodes in HTML

<HTML><BODY BGCOLOR="#FFFF00"><P>This is my very first web page!</P></BODY></HTML>


Recommended