A-Level Computing#BristolMet Session Objectives#9 express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal; describe and use two’s.

Slides:



Advertisements
Similar presentations
ICS312 Set 2 Representation of Numbers and Characters.
Advertisements

A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
Lecture - 2 Number systems and computer data formats
Computer Science 101 Binary Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions.
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Number System and Codes
The Binary Number System
Data Storage. SIGN AND MAGNITUDE Storing and representing numbers.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Computer Science 101 Number Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions.
Number Systems Computer Science 210 Computer Organization.
Binary Number Systems.
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Binary Representation and Computer Arithmetic
The Binary Number System
Introduction to Number Representation F451 Year 10 Computing Binary Numbers Binary Numbers Sign/Magnitude Sign/Magnitude 2s Complement 2s Complement Binary.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
Binary Arithmetic & Data representation
COMPSCI 210 Semester Tutorial 1
Computing Theory – F453 Number Systems. Data in a computer needs to be represented in a format the computer understands. This does not necessarily mean.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
ECE 331 – Digital System Design
The Teacher CP4 Binary and all that… CP4 Revision.
Positional Number Systems
1 IT 231, CMPE 331 Digital Logic Design Week 2 Number systems and arithmetic.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
The Teacher CP4 Binary and all that… CP4 Revision.
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Data Representation Conversion 24/04/2017.
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
GCSE Computing#BristolMet Session Objectives#8 MUST add two 8-bit binary integers SHOULD explain overflow errors COULD provide solutions to limit overflow.
IT1004: Data Representation and Organization Negative number representation.
1 COMS 161 Introduction to Computing Title: Computing Basics Date: September 8, 2004 Lecture Number: 7.
Reasons to  Binary With Mrs
Digital Logic Design Lab 1,2 By Nora Alaqeel.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Computer Organization 1 Data Representation Negative Integers.
Introduction to Number Representation A451 GCSE Computing.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
Two’s Complement The language of machines, part II.
Starter Using the mini whiteboards record your answers: 1) Name 2 different Character Sets 2) Convert the Hex number 9E into denary 3) Convert the binary.
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
Advanced Binary b. describe and use two’s complement and sign and magnitude to represent negative integers; c. perform integer binary arithmetic, that.
Computer Science 210 Computer Organization
Hexadecimal Conversions
Computer Science 210 Computer Organization
Unit 18: Computational Thinking
C1 Number systems.
Computer Architecture CST 250
Two’s Complement & Binary Arithmetic
Presentation transcript:

A-Level Computing#BristolMet Session Objectives#9 express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal; describe and use two’s complement and sign and magnitude to represent negative integers; perform integer binary arithmetic, that is addition and subtraction Create a GCSE calculator using an IF ELSE statement

A-Level Computing#BristolMet Binary Arithmetic & BCD Starter: How many binary digits would be required for this hexadecimal code and what is the 8 bit binary equivalent: #FF9B22

GCSE Computing#BristolMet Converting Binary to Hexadecimal Denary 45 in binary is or Split into 2 nibbles and treated as 4 bits each: = 2 = 13 = 2D TASK: Using the same method convert a) b) Now try the reverse, convert to binary a) A5 b) 3B a) EB b) A3 a) b)

A-Level Computing#BristolMet Binary Coded Decimal (BCD) Binary Coded Decimal (BCD) uses 4 bit binary to represent decimal digits 0 – 9. You simply split the digits and treat the separately. For example, decimal 75 in BCD is as follows: 7 = 5 = Therefore 75 in BCD becomes: Now convert the following denary into BCD: a)39 b)58 c)97

A-Level Computing#BristolMet Binary Arithmetic Another reason why computers are designed to use binary is that addition is so simple in binary. In binary there are only 4 sums which need to be known: = = = = 0, carry 1 For example;Now try: 75 = a) = = 89b) Carry

A-Level Computing#BristolMet Sign & Magnitude So far we have learned how to store positive whole numbers in binary but there is a need to use negative numbers and fractions. You will remember that only 7 bits is need to represent the ASCII character set (127 characters) and this is the purpose of the 8th bit, to represent a +/- For example: +/ = = This is called sign/magnitude representation – the byte is in 2 parts, the sign (+/-) and the size of the number.

A-Level Computing#BristolMet 2s Complement There are 2 problems with sign & magnitude representation. Firstly, the biggest number that can be represented is now halved – 127 instead of 255. Secondly, arithmetic now made more complicated as different bits means different things. A solution to this is using a system called 2s complement – the last bit stands for So the diagram looks like this: So -75 in 2s complement is: =

A-Level Computing#BristolMet Subtraction in binary Now using 2s complement subtraction is easier because 75 – 14 is the same as 75 + (-14) = = = 61 Carry 1 1 Now attempt a) b) 43 – 58 Some more examples:Click HereClick Here Why binary arithmetic – Watch this videoWatch this video