230 likes | 386 Views
Teaching Computing at KS3 Session 2. Sue Sentance and Sophie Baker Sue.sentance@anglia.ac.uk. From the CAS curriculum. KEY STAGE 2 Introduction to binary representation [representing names, objects or ideas as sequences of 0s and 1s].
E N D
Teaching Computing at KS3Session 2 Sue Sentance and Sophie Baker Sue.sentance@anglia.ac.uk
From the CAS curriculum • KEY STAGE 2 Introduction to binary representation [representing names, objects or ideas as sequences of 0s and 1s]. • KEY STAGE 3Introduction to binary manipulation. Representations ofunsigned integers
Today’s session 5:00 – 6:00 Binary numbers – converting between denary and binary 6.00 – 7.00 Programming in Scratch
Storing Binary Numbers Inside the computer eachbinarydigit is stored in a unit called a bit. A series of 8 bits is called a byte. A bit can take the values 0 and 1
What is meant by? 1 byte ? 1 nibble ? 1 kilobyte ? 1 megabyte ? 1 gigabyte ? 1 terabyte ?
Storing data 1 byte 1 nibble 1 kilobyte 1 megabyte 1 gigabyte 1 terabyte 1 byte = 8 bits 1 nibble = 4 bits 1 kilobyte = 1024 bytes = 2 10 bytes 1 megabyte = 2 20 bytes = 210 kilobytes 1 gigabyte = 2 30 bytes = 210megabytes 1 terabyte = 2 40bytes = 2 10 gigabytes
Learning binary numbers Converting binary to denary Converting denary to binary
Base 10 (Denary) 10 different symbols to represent values:0 1 2 3 4 5 6 7 8 9 Values greater than 9 are represented using the place value convention:100s 10s 1s 3 5 7= 3x100 + 5x10 + 7x1ie. Three hundred and fifty seven Base 2 (Binary) 2 different symbols to represent values:0 1 Values greater than 1 are represented using the place value convention:8s 4s 2s 1s 1 1 0 1 = 1x8 + 1x4 + 0x2 + 1x1=Thirteen Number Bases 1 2 100 8 10 1 4 0 1 1 1 3 5 7
How to convert Binary Numbers to denary Place values 8+ 0+ 2 + 0 = 10 in Denary 8 4 2 1 1 0 1 0
How to convert Binary Numbers to denary 128+0+0+16+8+ 0+ 2 +1 = 155 in Denary Place values 128 64 32 16 8 4 2 1 0 0 0 1 1 0 1 1
Converting binary to denary Convert the binary number 1011 0111 into denary: Answer 128 64 32 16 8 4 2 1 1 0 1 1 0 1 1 1 =128+32+16+4+2+1=183
Conversion Exercise Convert the following binary numbers into denary: 0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1
Conversion Exercise Convert the following binary numbers into denary: Answers in red: 0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 2 9 4 15 6 10 5 12 31 23 21
Teaching binary Holding cards up activity Finger binary Cisco binary game CS Unplugged actitivies
Converting Denary to Binary • Write down the column headings for the binary number:64 32 16 8 4 2 1 • Process each column from left to right. • If the denary number to be translated is greater than or equal to the column heading, place a 1 in the column and subtract the value of the column from the denary value. • If the denary value is smaller than the column heading, place a 0 in the column.
Example Convert 27: 27 < 64, so 0 into 64-column 27 < 32, so 0 into 32-column 27 > 16, so 1 into 16-column, new value = 27 – 16 = 11 11 > 8, so 1 into 8-column, new value = 11 – 8 = 3 3 < 4, so 0 into 4-column 3 > 2, so 1 into 2-column, new value = 3 – 2 = 1 1 = 1, so 1 into 1-column 64 32 16 8 4 2 1 0 0 1 1 0 1 1
Storing Numbers - Binary EXAMPLE Convert the denary number 227 into binary: 128 64 32 16 8 4 2 1 11 1 0 0 011
Convert to Binary 3 5 8 7 11 16 32 21 14 17 48 255
Convert to Binary 3 5 8 7 11 16 32 21 14 17 48 255 0111 11 101 1000 10000 100000 10101 1011 110000 11111111 10001 1110
Summary – why teach binary? Binary is a set of instructions used to control the computer, and works with 1s and 0s The computer understands them as on or off signals. If the decimal system were used, there would need to be 10 different voltages, in which case there'd be more room for error with resistors etc., and therefore more room for corruption of data. Today, the elementary building block for all modern computer systems is the transistor. A transistor is simply a switch, much like the light switch mentioned earlier. A transistor can be in an off state, which does not allow electricity to flow, or in an on state, in which electricity can pass unimpeded. A transistor is a solid-state device that has no mechanical or moving parts. The switching of a transistor from the off state to the on state, or vice versa, is done electronically rather than mechanically. This allows it to be fast as well as extremely small. So learning binary helps students to understand how a computer works