NUMBER SYSTEMS IN COMPUTING Stuart Davison CAS Master

Slides:



Advertisements
Similar presentations
Technology ICT Option: Data Representation. Data Representation In our everyday lives, we communicate with each other using analogue data. This data takes.
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Connecting with Computer Science, 2e
1 Chapter Overview Computer Communication The Computer Bus Objectives  Understand how a computer transmits and receives information.  Explain the principles.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition.
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
ENEL 111 Digital Electronics Richard Nelson G.1.29
Lesson Objectives Explain the use of binary codes to represent characters Explain the term “Character set” Describe with examples (for examples ASCII and.
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
1 Survey of Computer Science CSCI 110, Spring 2011 Lecture 16 Digital Circuits, binary Numbers.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Higher Computing Data Representation.
Topics Introduction Hardware and Software How Computers Store Data
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Digital Electronics. Digital circuits work on the basis of a transistor being used as a switch. Consider a light switch, a transistor can be considered.
Data Representation Int 2 Computing Unit 1 – Computer Systems St Kentigern’s Academy.
Chapter 2 Computer Hardware
Computing Theory – F453 Number Systems. Data in a computer needs to be represented in a format the computer understands. This does not necessarily mean.
1 INFORMATION IN DIGITAL DEVICES. 2 Digital Devices Most computers today are composed of digital devices. –Process electrical signals. –Can only have.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
Data Representation Conversion 24/04/2017.
Data Representation, Number Systems and Base Conversions
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
MECH1500 Chapter 3.
M204 - Data Representation
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
Computer Science 4 On and OFF. Homework What have we created.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
A+ Computer Repair Lesson 3: Number System. Objectives Define binary, decimal, octal, and hexadecimal numbering systems. Define binary, decimal, octal,
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
What do you think this lesson is all about? Write your answer on a sticky note.
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
Digital System Design. Objective Distinguish between Two worlds Understand the Properties digital system.
Understanding Computers
Data Representation. In our everyday lives, we communicate with each other using analogue data. This data takes the form of: Sound Images Letters Numbers.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
Understanding Binary Understanding Computers. Understanding Computers L3 – Understanding Binary Learning Objectives All will Understand why all data is.
DATA REPRESENTATION - TEXT
Understanding binary Understanding Computers.
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
Invitation to Computer Science, C++ Version, Fourth Edition
Chapter 3 - Binary Numbering System
Digital Electronics Jess 2008.
COMP 1321 Digital Infrastructure
Intermediate 2 Computing
…to GCSE Level with Python Sue Sentance
Invitation to Computer Science, Java Version, Third Edition
Folders out, planners out…
Saturday, 10 November 2018 Binary
Images in Binary.
Ch2: Data Representation
For OCR GCSE Computing Unit 1 - Theory
Topics Introduction Hardware and Software How Computers Store Data
Data Representation Conversion 05/12/2018.
Fundamentals of Data Representation
Data Binary Conversion.
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Option: Data Representation
Option: Data Representation
WJEC GCSE Computer Science
Presentation transcript:

NUMBER SYSTEMS IN COMPUTING Stuart Davison CAS Master

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

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

Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback How do computers count? Session 1: Computer number systems

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.

Circuits To illustrate this consider a basic electrical circuit:

What happens? When the switch is on, current can flow around the circuit. The voltage across the lightbulb could be measured over time:

How does this apply to computing? Components in a computer are built upon millions of similar switches called transistors.

Combining transistors These transistors can be combined to form logic gates:

Combining logic gates Logic gates are then combined to carry out simple operations.

Combining logic gates …and then more useful functions:

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.

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.

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.

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.

Try some basic binary activities. We will attempt to understand the theory behind it after completing them.

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.

Combining bits Binary numbers are made from bits. The placement of these bits affects the contribution to the overall value of the number Units Consider the binary byte 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 )

Naming of groups Just as decimal values have names for groups of numbers so do groups of binary values.

Prefix Large multiples of numbers can also be referred to using a prefix.

Now that we understand how binary works, we can start to see how it can be used.

Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback How could this be taught? Session 2: Applications of binary

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

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.

Binary to denary Useful to visualise as a spreadsheet activity. Try to get it working on your computer now.

Denary to binary Can also be done in a spreadsheet but the method requires a lot more thought 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, ( = 2) 3. Is 2 greater than or equal to 64? 4. No – put 0 under 64 then carry on…

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: Start value

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.

Part 1 User inputs value to convert. Initialise variable and list used later. Nothing to change here.

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(??)

Part 3 Output message. Reverse list. Why?

Part 4 Loop through list, displaying each bit of the binary value on the same line.

Use the skeleton file to try and complete the solution.

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

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.

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.

Messages using ASCII Courtesy of

Sound data Again, binary values need to represent real-world information.

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.

Use Python file to make music Courtesy of

Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Making binary more convenient! Session 3: Alternative number systems

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.

Bitmap example 8x8 = 64 pixels Each pixel uses 4 bits 4x64 = 256 bits for this file (filesize)

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.

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!

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.

Suitable task Again, spreadsheets are useful in this situation. A bitmap simulation can be created using conditional formatting.

Follow instructions to create bitmap model.

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

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

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 , Twitter, etc. Webinar

Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Questions

Overview Housekeeping Introduction Session 1 Session 2 Session 3 Plenary Homework Webinar Questions Feedback Go to: tinyurl.com/qy2jz2o Course code: StuartDavison About me / content / venue – Online review of course – About CAS – Forums (community.computingatschool.org.uk/door) – Local Hub (Nick Frost - Feedback