Programming for GCSE Topic 2.2: Binary Representation T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science.

Slides:



Advertisements
Similar presentations
Programming for GCSE Topic 9.1: Logic Circuits T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen Mary.
Advertisements

Learning Objectives Explain the link between patterns, symbols, and information Determine possible PandA encodings using a physical phenomenon Encode.
Craig Schock, 2003 Binary Numbers Numbering Systems Counting Symbolic Bases Common Bases (10, 2, 8, 16) Representing Information Binary to Decimal Conversions.
Comp 1001 Introduction to Information Technology & Computer Architecture Wednesday 12-1Dr. Joe Carthy
EECC250 - Shaaban #1 lec #13 Winter HEX DEC CHR Ctrl 00 0NUL 01 1 SOH ^A 02 2STX ^B 03 3ETX ^C 04 4EOT ^D 05 5ENQ ^E 06 6ACK ^F 07 7BEL.
28-Jun-15 Number Systems. 2 Bits and bytes A bit is a single two-valued quantity: yes or no, true or false, on or off, high or low, good or bad One bit.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Representing Information Digitally Bits and the “Why” of Bytes lawrence snyder.
9/14/2004Comp 120 Fall September 2004 First Exam next Tuesday 21 September Programming Questions? All of Chapter 3 and Appendix A are relevant.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Mantıksal Tasarım – BBM231 M. Önder Efe
Digital Text Primer Prepared for: AIEA Roundtable on Digitization of Armenian Documents Saturday 7 October 2006, University of Geneva, Switzerland Roland.
Characters & Strings Lesson 1 CS1313 Spring Characters & Strings Lesson 1 Outline 1.Characters & Strings Lesson 1 Outline 2.Numeric Encoding of.
1 Data Representation Computer Organization Prof. H. Yoon DATA REPRESENTATION Data Types Complements Fixed Point Representations Floating Point Representations.
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Agenda Data Representation – Characters Encoding Schemes ASCII
The character data type char
Chapter 7 Data Coding. Agenda Coding Code efficiency and conversion Compression/compaction Code encryption/decryption.
BIOS1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
Digital Design: From Gates to Intelligent Machines
Decimal Binary Octal Hex
Logic and Digital System Design - CS 303
BIOS1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
PHY281Variables operators and math functions Slide 1 More On Variables and Operators, And Maths Functions In this section we will learn more about variables.
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DATA REPRESENTATION Dept. of Computer Science Engineering Islamic Azad University.
Informatics I101 February 25, 2003 John C. Paolillo, Instructor.
Postacademic Interuniversity Course in Information Technology – Module C1p1 Chapter 1 Evolution of Communication Networks.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Representing Information Digitally Bits and the “Why” of Bytes lawrence snyder.
Lecture 4: Number Systems (Chapter 3) (1) Data TypesSection3-1 (2) ComplementsSection3-2 (3) Fixed Point RepresentationsSection3-3 (4) Floating Point RepresentationsSection3-4.
CS151 Introduction to Digital Design
1 3 Computing System Fundamentals 3.5 Data Representation.
CEC 220 Digital Circuit Design Number Systems & Conversions Friday, January 9 CEC 220 Digital Circuit Design Slide 1 of 16.
1 Information Representation in Computer Lecture Nine.
Agenda Character representation Numerical Conversions ASCII EBCDIC
CS 2130 Lecture 23 Data Types.
Systems Architecture, Fourth Edition 1 Data Representation Chapter 3.
CEC 220 Digital Circuit Design Number Systems & Conversions Wednesday, Aug 26 CEC 220 Digital Circuit Design Slide 1 of 16.
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
PRIMITIVE TYPES IN JAVA Primitive Types Operations on Primitive Types.
Binary Representation in Text
Pale Blue Dot is a photograph of planet Earth taken on February 14, 1990, by the Voyager 1 space probe from a record distance of about 6 billion kilometers,
4th Edition, Irv Englander
Bits, Data Types, and Operations
Chapter 2 Bits, Data Types, and Operations
Machine level representation of data Character representation
Chapter 3 Data Representation Text Characters
Digitizing Discrete Information
Binary Numbers and ASCII and EDCDIC
DATA REPRESENTATION Data Types Complements Fixed Point Representations
CHAPTER 1 : INTRODUCTION
Chapter 2 Data Types and Representations
Javascript, Loops, and Encryption
Chapter 2 Bits, Data Types, and Operations
Chapter 2 Bits, Data Types, and Operations
ASCII Character Codes nul soh stx etx eot 1 lf vt ff cr so
Introduction to Computer Engineering
October 1 Programming Questions?
DATA REPRESENTATION Data Types Complements Fixed Point Representations
Cosc 2P12 Week 2.
Number Systems Lecture 2.
Text Encoding.
School of Computer Science and Technology
Introduction to Computer Engineering
DATA REPRESENTATION Data Types Complements Fixed Point Representations
Beyond Base 10: Non-decimal Based Number Systems
Rayat Shikshan Sanstha’s S. M. Joshi College, Hadapsar
Text Representation ASCII Collating Sequence
DATA REPRESENTATION Data Types Complements Fixed Point Representations
Cosc 2P12 Week 2.
Chapter 2 Bits, Data Types, and Operations
Presentation transcript:

Programming for GCSE Topic 2.2: Binary Representation T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London

Aims Introduce binary number representations Count in binary Do binary arithmetic … same rules as normal (decimal), fewer digits Understand that binary also represents Characters …

Teaching Issue Some people find this material easy … … others less so Every one can count and do arithmetic! How to make it as simple as possible? At first, avoid mathematics of exponents (2 0, 2 1, 2 2 etc)

W HY B INARY ?

Counting in Tens Why do we count with 10 digits (0-9)? Romans used I, II, III, IV, VI, VII … Babylonians counted in 60 Our numbers are Arabic – importance of ‘zero’ Some early computers used decimal Babbage’s mechanical computer ENIAC in USA

Switches make Computers Analog versus Digital Analog signal: any value Digital signal: only two values analogue digital high low closed open

C OUNTING IN B INARY

Binary – Base 2 Decimal Ten digits: ‘0’ to ‘9’ Two digits: ‘0’ and ‘1’ Binary digit – ‘bit’ Count on two fingers

Number After – Decimal Familiar Rules? 0  1 1  2 9       1000 Rule for the next number Starting from the right hand side, look at each digit ‘d’ in turn: 1.If d not last  next and stop 2.If d is last  0, go on to next digit. 3.If there are no more digits, put a ‘1’

Number After – Binary Two digits Same rules 0  1 1     

Quiz Write down the number after each of the following numbers 0  ?? 1  ?? 100  ?? 101  ?? 110  ?? 1000  ?? 1100  ?? 1111  ??  ??  ??  ??  ??  ??  ??  ??  ??

Quiz Write a list of 4-digit binary numbers in order

Binary 0 – 15 Write a list of 4-digit binary numbers in order

Binary 0 – 15: Patterns Write a list of 4-digit binary numbers in order

Binary 0 – 15: Patterns Write a list of 4-digit binary numbers in order

O CTAL AND H EXADECIMAL N UMBERS

Octal and Hexadecimal Octal – base 8 Hexadecimal – base 16 Direct conversion to/from binary

Octal – Base 8 Digits 0 – 7 Each octal digit is 3 binary digits octal binary

Hex – Base 16 Digits 0 – 9, A – F Each hex digit stands for 4 binary digits hex binary A1010 B1011 C1100 D1101 E1110 F1111 hex binary

Hex – Example AC H hex binary A1010 B1011 C1100 D1101 E1110 F1111 hex binary

R EPRESENTING C HARACTERS

ASCII American Standard Code for Information Interchange First standardised in bit character code 0 – 127 Parity bit Characters are Printable – 95 Control – 33 !"#$%&'()*+,-./ :; `abcdefghijklmnopqrstuvwxyz{|}~

A B C D E F 0 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 SP ! " # $ % & ' ( ) * +, -. / : ; ? A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 ` a b c d e f g h i j k l m n o 7 p q r s t u v w x y z { | } ~ DEL ASCII in Hex ‘A’ is 41 H = 65 ‘2’ is 32 H = 50

ASCII Features – Digits The digits 0-9 are represented with their values in binary prefixed with 0011 (I.e. 3 H ) ‘0’ is 30 H ‘9’ is 39 H

ASCII Features – Characters Letters are in a contiguous sequences No gaps Lowercase and uppercase letters apart Single bit difference A – Z : 41 H – 5A H a – z : 61 H – 7A H

ASCII Limitations Only 95 printable characters accents non-Latin languages Chinese-based scripts Unicode 16 bits Overlaps with ASCII where possible

A DDING B INARY N UMBERS

Adding Binary Digits Very simple rules = = = = 0 carry 1

Adding Binary Numbers Complete the following

Adding Binary Numbers Complete the following

Adding Binary Numbers Complete the following Carry

Adding Binary Numbers Complete the following

Quiz Complete

Summary Start by counting … get used to binary Conversion tables Addition – apply standard rules Octal and hexadecimal Easy really At first, avoid mathematics of exponents (2 0, 2 1, 2 2 etc)