Download presentation
Presentation is loading. Please wait.
Published byGloria Holland Modified over 9 years ago
1
NUMBER SYSTEMS IN COMPUTING Stuart Davison CAS Master Teacher @Mr_Comp_Sci stuart.davison@computingatschool.org.uk
2
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback 14:15Arrival – Registration 14:30Session overview 14:40Computer number systems 15:20Applications of binary 16:40Alternative number systems 17:20Plenary, questions and feedback Housekeeping
3
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Learning Outcomes: By the end of today you will be able to: Explain the need for different number systems within a computer Write a program to convert between binary and denary Describe the relationship between different computing number systems. Introduction
4
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback How do computers count? Session 1: Computer number systems http://scienceblogs.com/goodmath/2006/10/11/binary-fingermath/
5
Computers A computer is an electrical device. These electrical devices use electricity to carry out instructions and store data. Electricity is the flow of electrons around a closed circuit (conductors connected in a loop). The energy given to move the electrons is called voltage and the rate at which they flow is known as current.
6
Circuits To illustrate this consider a basic electrical circuit: http://scratch.mit.edu/projects/2242013/
7
What happens? When the switch is on, current can flow around the circuit. The voltage across the lightbulb could be measured over time: http://learn.linksprite.com/pcduino/arduino-ish-program/pwm/breathing-light-experiment-on-pcduino/
8
How does this apply to computing? Components in a computer are built upon millions of similar switches called transistors. http://www.allaboutcircuits.com/vol_6/chpt_5/8.html
9
Combining transistors These transistors can be combined to form logic gates: http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/trangate.html
10
Combining logic gates Logic gates are then combined to carry out simple operations. http://en.wikipedia.org/wiki/File:R-S_mk2.gif
11
Combining logic gates …and then more useful functions: http://www.waitingforfriday.com/images/e/e1/Logic_design_PNG.png
12
Executing instructions Ultimately, circuits are combined so that many different operations can be performed. The results of these operations are almost instantaneous and this is what makes computers operate so quickly.
13
Processing real data The problem is humans represent data in the real world in many different ways. In order to “send” data into a computer to be used, it needs to be turned into something that can be used by the electronic circuits we build.
14
A simple number system As all operations and data in a computer are processed using on and off voltages we need a system to utilise this. The binary number system is ideally suited to this task. If an ON voltage is detected it can represent a binary 1 value; if an OFF voltage is detected then use a 0 value. http://www.sqa.org.uk/e-learning/NetTechDC01ECD/page_12.htm
15
Groups Components of a computer need to be connected to each other so that these signals can be sent and received. These signal paths can be arranged either serially or in parallel but the end result is the same. A series of ON and OFF voltages are combined to represent data. http://www.cl.cam.ac.uk/~djg11/howcomputerswork/
16
Try some basic binary activities. We will attempt to understand the theory behind it after completing them.
17
Binary Referred to as base-2 as there are only two different counting symbols. Compare this to numbers humans use, which is called base-10. http://ayumiikeda0809.blogspot.co.uk/2013/09/the-terms-bit-byte-binary-d.html
18
Combining bits Binary numbers are made from bits. The placement of these bits affects the contribution to the overall value of the number. 128643216842Units 00111011 Consider the binary byte 00111011 Each bit of the byte is entered into the number weighting table. The values with one underneath are added together to get the denary equivalent, (eg. 32+16+8+2+1.)
19
Naming of groups Just as decimal values have names for groups of numbers so do groups of binary values.
20
Prefix Large multiples of numbers can also be referred to using a prefix. http://www.kcnn.org/resources/journalism_20_chapter1
21
Now that we understand how binary works, we can start to see how it can be used.
22
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback How could this be taught? Session 2: Applications of binary http://www.shinyshack.com/product.php?prid=211626
23
What pupils need to know What binary is. How it is used by computer. How binary is used to represent data such as: – Numbers – Characters – Sound – Images
24
Representing numbers The most straight-forward application of binary. Each bit in a binary value represents a different value. At GCSE pupils are required to convert between binary and denary. Variety of methods to complete the actual conversion.
25
Binary to denary Useful to visualise as a spreadsheet activity. Try to get it working on your computer now.
26
Denary to binary Can also be done in a spreadsheet but the method requires a lot more thought. 1286432168421 1 0 To convert 130 to binary start with the most significant bit…. 1. Is 130 greater than or equal to 128? 2. Yes – put 1 under 128 then find remaining value, (130 - 128 = 2) 3. Is 2 greater than or equal to 64? 4. No – put 0 under 64 then carry on…
27
Denary to binary An alternative is the divide by 2 method. This lends itself well to a programmed solution. 19 ÷ 2 = 9 remainder 1 9 ÷ 2 = 4 remainder 1 4 ÷ 2 = 2 remainder 0 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 Read remainders from bottom to get the binary value: 10011 Start value
28
Implementing in Python You are going to adapt a skeleton file to convert an integer typed by a user into a single binary value displayed on screen. Does assume some experience with Python so try to use for building on skills developed in prior lessons.
29
Part 1 User inputs value to convert. Initialise variable and list used later. Nothing to change here.
30
Part 2 Loop all the time that decValue variable is above 0. Two division operations on decValue: one to find remainder (modulo) and one to find whole part (floor divide.) Add the bit value to the list binValue, eg. binValue.append(??)
31
Part 3 Output message. Reverse list. Why?
32
Part 4 Loop through list, displaying each bit of the binary value on the same line.
33
Use the skeleton file to try and complete the solution.
34
Representing characters Consider when a key is pressed on a keyboard. Characters need to be formatted as 1s and 0s. There are two main schemes for encoding characters on a keyboard for use by a computer: – ASCII – Unicode
35
ASCII American Standard Code for Information Interchange. Agreed set of codes to represent the main character set used in telegraph systems (1960s). Initially 7 bits used for 128 possible codes, (32 of which are control characters.) Later extended to 8-bits effectively doubling the size of the character set.
36
Unicode ASCII is not detailed enough to be useful for all different languages, (Mandarin, Urdu, etc.) Unicode system developed to utilise 32-bits providing more than 4 billion possible characters. The first 128 characters of Unicode match standard ASCII.
37
Messages using ASCII Courtesy of http://community.computingatschool.org.uk/resources/1146
38
Sound data Again, binary values need to represent real-world information. http://hyperphysics.phy-astr.gsu.edu/hbase/audio/spk2.html
39
Sound data Changes in air pressure reflect sounds we hear. Sound can be measured at regular intervals and assigned a binary value. Sampling rate and bit- depth affect quality. http://www.planetoftunes.com/digital-audio/how-do-analogue-to-digital-converters-work.html
40
Use Python file to make music Courtesy of http://community.computingatschool.org.uk/resources/666
41
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Making binary more convenient! Session 3: Alternative number systems http://en.wikipedia.org/wiki/Hexadecimal
42
Images Images can be stored in a variety of ways. A common method is bitmapping. Images are stored as a grid of values and each of these points on the grid are referred to as pixels. Each pixel is given a colour value.
43
Bitmap example http://aivolkov.narod.ru/compclass/raster-vector/index.htm 8x8 = 64 pixels Each pixel uses 4 bits 4x64 = 256 bits for this file (filesize)
44
Colour depth Colour depth refers to how many bits are used to describe the colour of each pixels. A higher colour depth allows more colours to be used but results in a larger file being created. Trade-off between quality and file size.
45
Convenience As the colour depth increases it becomes more difficult for a human to understand what the binary values represent. The hexadecimal number system can help to summarise long binary or denary values. For example, to set text as white you can use: This is some text!
46
Hexadecimal numbers Hexadecimal is base-16. 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Again, counting works in the same way. When you have finished using all the symbols you start again and add one onto the next column. http://www.colorsontheweb.com/colorsontheweb.asp
47
Suitable task Again, spreadsheets are useful in this situation. A bitmap simulation can be created using conditional formatting. http://www.coranac.com/tonc/text/bitmaps.htm
48
Follow instructions to create bitmap model.
49
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Explain the need for different number systems within a computer Write a program to convert between binary and denary Describe the relationship between different computing number systems. Plenary
50
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Research octal numbers. Adapt any examples seen today to use this alternative number system. Homework
51
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Support available remotely at a convenient time Chance to ask questions and run through examples Also communicate via email, Twitter, etc. Webinar
52
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Questions
53
Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Go to: tinyurl.com/qy2jz2o Course code: StuartDavison20052014 About me / content / venue – Online review of course – Email (stuart.davison@computingatschool.org.uk) About CAS – Forums (community.computingatschool.org.uk/door) – Local Hub (Nick Frost - n.frost@kegschg.bham.sch.uk) Feedback
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.