Presentation is loading. Please wait.

Presentation is loading. Please wait.

C omputing Making binary relevant to programming An education collaboration: Langley Grammar School.

Similar presentations


Presentation on theme: "C omputing Making binary relevant to programming An education collaboration: Langley Grammar School."— Presentation transcript:

1 C omputing Making binary relevant to programming An education collaboration: Langley Grammar School

2 C omputing Copyright This educational resource is available for free download for personal and educational use. It is distributed under a Creative Commons Attribution – Noncommercial – NoDerivs licence, for more details please visit the Creative Commons website.Creative Commons website. Essentially it means that you are free to copy, distribute, and display these educational resources provided you make no changes to the content (including the attribution to the authors and these license terms); you may not use these educational resources for commercial purposes, and you may not alter, transform, or build upon this. We encourage the use of these materials in educational setting, and you are welcome to print your own copy of the book and distribute worksheets from it to students. Any of the above conditions maybe waived if you get written permission from the copyright holder. We welcome enquiries and suggestions, which should be directed to the author on dsh@lgs.slough.sch.uk dsh@lgs.slough.sch.uk

3 C omputing Denary explained NumberTHTU 50005 400040 1460146 Explanation: Think back to when you were in primary school. You learnt to organise numbers in multiples of ten’s It makes it easier that you have ten fingers and thumbs.

4 C omputing Denary NumberTHTU 1460146 0003 5 24 0065 93 131 0179 255

5 C omputing Denary NumberTHTU 1460146 30003 50005 240024 650065 930093 1310131 1790179 2550255

6 C omputing Binary explained Number1286432168421 500000101 3600100100 14610010010 Explanation: Binary is the language computers understand. Computers only work with values of 1 and 0. The reason for this is computers work on circuit boards where there is either high voltage (1) or low voltage (0).

7 C omputing Learning Binary CS Unplugged activity: http://csunplugged.org/sites/default/files/activity_pdfs_full/unplugg ed-01-binary_numbers.pdf http://csunplugged.org/sites/default/files/activity_pdfs_full/unplugg ed-01-binary_numbers.pdf

8 C omputing Binary Number1286432168421 14610010010 00000011 5 24 01000001 93 131 10111000 255

9 C omputing Binary Number1286432168421 14610010010 300000011 500000101 2400011000 6501000001 9301011101 13110000011 18410111000 25511111111

10 C omputing CS Unplugged activity: http://csunplugged.org/sites/default/files/activity_pdfs_full/unplugg ed-01-binary_numbers.pdf http://csunplugged.org/sites/default/files/activity_pdfs_full/unplugg ed-01-binary_numbers.pdf Extension

11 C omputing Bit of a byte No of bits/bytesCommon description of bits/bytes 1 bita 1 or a 0 (b) 4 bits1 nibble 8 bits1 byte (B) 1024 bytes (1024 x 8 bits)1 Kilobyte (KB) 1024 Kilobytes1 Megabyte (MB) 1024 Megabytes1 Gigabyte (GB) 1024 Gigabytes1 Terabyte (TB)

12 C omputing Hexadecimal explained 1 Explanation: Used as a shorthand notation for binary number patterns! Converting denary numbers into hexadecimal. Step 1: First convert the denary number 146 into binary (10010010). Step 2: Then divide the byte i.e. 8 bits, into two nibbles i.e. 4 bits (1001 | 0010). Step 3: Use the Binary to hexadecimal table to find out the hexadecimal ( 1001 = 9 and 0010= 2 ). Step 4: Put the answers together ( 92 ). Number1286432168421Hexadecimal 1461001001092 DenaryBinaryHexadecimal 910019 200102

13 C omputing Binary into Hexadecimal DenaryBinaryHexadecimal 111 2102 3113 41004 51015 61106 71117 810008 910019 101010A 111011B 121100C 131101D 141110E 151111F 161000010 Binary to hexadecimal table

14 C omputing Hexadecimal explained 2 Number1286432168421Hexadecimal E3 DenaryBinaryHexadecimal 2271110/0011E3 Explanation: Used as a shorthand notation for binary number patterns! Example: converting E3 hexadecimal into a number Step 1: First start with the two characters E and 3. Step 2: Using the Hexadecimal to denary table work out the binary for E ( 1110 ) and for 3 ( 0011 ). Step 3: Put these together ( 11100011 ). Step 4: Work out what the denary number using the binary ( 128+64+32+2+1 = 227 )

15 C omputing NumberHex 3321 462E 633F 6440 6541 6642 6743 6844 6945 7046 7147 7248 7349 744A 754B NumberHex 764D 774E 784F 7950 8051 8152 8253 8354 8455 8556 8657 8758 8859 895A 904D NumberASCII 9761 9862 9963 10064 10165 10266 10367 10468 10569 1066A 1076B 1086C 1096D NumberHex 1106E 1116F 11270 11371 11472 11573 11674 11775 11876 11977 12078 12179 1227A Binary into Hexadecimal Denary into Hexadecimal table : Check your answers

16 C omputing Hexadecimal Number1286432168421Hexadecimal 1461001001092 10010010 00000011 5 16 01000001 97 6D 10111000 227

17 C omputing Hexadecimal Number1286432168421Hexadecimal 1461001001092 1461001001092 30000001103 50000010105 160001000010 650100000141 970110000151 109011011016D 18410111000B8 22711100001E1

18 C omputing ASC II explained Explanation: ASCII – American Standard Code for Information Interchange Uses 7 bits of a byte to represent 128 characters that humans can use to represent numbers and letters. The eight bit of the byte is used as a parity (check) digit. Number6432168421ASCII 671000011C Binary Number ASCII 65A 66B 67C 68D

19 C omputing Binary Number ASCII 33! 46. 63? 64@ 65A 66B 67C 68D 69E 70F 71G 72H 73I 74J 75K Binary Number ASCII 76L 77M 78N 79O 80P 81Q 82R 83S 84T 85U 86V 87W 88X 89Y 90Z Binary Number ASCII 97a 98b 99c 100d 101e 102f 103g 104h 105i 106j 107k 108l 109m Binary Number ASCII 110n 111o 112p 113q 114r 115s 116t 117u 118v 119w 120x 121y 122z Binary into ASCII Characters

20 C omputing ASC II Number6432168421ASCII 671000011C 1111101111 1091101101 1121110000 1171110101 116t 1051101001 110n 1031100111 33!

21 C omputing ASC II Number6432168421ASCII 671000011C 1111101111o 1091101101m 1121110000p 1171110101u 1161110100t 1051101001i 1101101110n 1031100111g 330100001!

22 C omputing Error Checking Error checking An extra (Parity) bit, is added to the bit pattern for ASC II characters for checking. A computer uses either odd or even parity. In a odd-parity system the extra bit is set so that the total number of 1 bits in a bit pattern is an odd number. In a even-parity system the extra bit is set so that the total number of 1 bits in a bit pattern is an even number. What if there is an error? It will resend (transmit) the message again. CharacterParity6432168421 F11100110 CharacterParity6432168421 F01100110 Character6432168421 F1100110

23 C omputing ASC II (eighth bit) Error checking activity: http://csunplugged.org/error-detectionhttp://csunplugged.org/error-detection (Magic Trick) Explanation: What about the eighth bit of the byte that is used as a parity (check) digit? How does it work?

24 C omputing Compilers and interpreters United Nations analogy Discuss the following points: Which politician (A, B or C) will have the best understanding during the speech and why? What benefits and problems would the politician have from listening to the speech at the time? Which translation will be of the better quality: the immediate translation through the headphones or the written translated transcript completed after the speech? What benefits and problems would the politician have from reading the translated script after the speech?

25 C omputing Link to computing Compliers In a compiler the code for the whole program is converted only once, which can be a slow process, but once it is compiled the executable file is then stored on the hard disk. You will have seen these on your computer as files ending in.exe, such as WinWord.exe for Microsoft Word and Excel.exe for Microsoft Excel. It is much faster to run a compiled program as it is in the language the computer understands. The code of executable file cannot be altered once it has been created.

26 C omputing Link to computing Interpreters When an interpreter runs, it reads each line of code in the program and converts it line by line. This happens every time the program is run. Consequently it is very slow as it is converting the program code while the program is running. It can be as much as 5-10 times slower than running the executable file; because every line of code has to be re-read, then re-processed each time the program is run.

27 C omputing Link to computing Thinking: Relate the above two forms of translation in the UN analogy to compilers and interpreters. (a) the immediate translation through the headphones (b) the written translated transcript completed after the speech. Which represents the compiler and why? Which represents the interpreter and why?

28 C omputing Roller coaster interpreter Programming Language Motor question IF log fume is at the top THEN wait 0.01 second and turn off motor ELSE loop back to motor question Binary programme 1101010101010110101010111110010 1010101010101001010101010101010 0101001001010100100101001010100 0000101010101010010100001001010 1010101010000100101010010010100 1010100000010101010101001010000 1001010101010101000101010110101 0101111100101010101010101001010 1010101010100101001001010100100


Download ppt "C omputing Making binary relevant to programming An education collaboration: Langley Grammar School."

Similar presentations


Ads by Google