Information Processing Session 5B Binary Arithmetic Slide 000001.

Slides:



Advertisements
Similar presentations
Intro to CS – Honors I Representing Numbers GEORGIOS PORTOKALIDIS
Advertisements

Information Processing
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 4.2 Binary numbers: Arithmetic
IT Systems Number Operations EN230-1 Justin Champion C208 –
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
System Environment Part 1 The Register Level. Module Content “Systems environment” is a term used to describe the hardware and software structures which.
CISCO NETWORKING ACADEMY Chabot College ELEC 74A Hexadecimal Introduction.
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Computer Systems 1 Fundamentals of Computing
Binary Conversions Number systems Binary to decimal Decimal to binary.
Real Numbers and the Decimal Number System
Binary and Hexadecimal Numbers
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
NUMBER SYSTEMS.
The Binary Number System Emily Beck and Susan Cantrell.
Numbering systems.
Number Systems Binary and Hexadecimal. Base 2 a.k.a. Binary  Binary works off of base of 2 instead of a base 10 like what we are taught in school 
Numeral Systems Subjects: Numeral System Positional systems Decimal
Numbering Systems CS208.
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
How Computers Work Dr. John P. Abraham Professor UTPA.
CSCI N301: Fundamental Computer Science Concepts Copyright ©2006  Department of Computer & Information Science The Switch, Part One.
IT253: Computer Organization
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Chapter 4: Representation of data in computer systems: Number OCR Computing for GCSE © Hodder Education 2011.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in other bases.
Binary Values and Number Systems
Positional Notation 642 in base 10 positional notation is:
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.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
THE BINARY SYSTEM.
Data Representation, Number Systems and Base Conversions
Visualizing Decimal and Binary
Candidates should be able to:
Computer Science Introduction to the Number Base Unit Adapted from Slides by John Owen Computer Science Instructor, Rockport-Fulton High School, Rockport,
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
CS1Q Computer Systems Lecture 2 Simon Gay. Lecture 2CS1Q Computer Systems - Simon Gay2 Binary Numbers We’ll look at some details of the representation.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
 2012 Pearson Education, Inc. Slide Chapter 4 NumerationSystems.
Numbering Systems and Conversion Understand How Computing Devices Work 1.
Understanding Computers
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Computer Maintenance Numbering Systems Copyright © Texas Education Agency, All rights reserved.1.
Number systems Visualizing Decimal and Binary. We count in base 10 because people started by counting on their fingers Base 10 is a number system that.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative 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.
Programmable Logic Controller
Binary & Hex Review.
Understanding binary Understanding Computers.
Computer Maintenance Numbering Systems Trade & Industrial Education
Binary, Denary, Hexadecimal Conversion Binary Addition
Binary and Hexadecimal
Data Representation – numbers Binary conversion Hexadecimal Negative numbers Binary addition Binary shifts.
Lesson Objectives Aims
Number Systems.
COMPUTING FUNDAMENTALS
Convert Decimal to Binary
Number System conversions
Fundamentals & Ethics of Information Systems IS 201
Numbering System TODAY AND TOMORROW 11th Edition
Digital Electronics and Microprocessors
How Computers Store Data
Chapter Four Data Representation in Computers By Bezawit E.
Binary & Hex Review.
Presentation transcript:

Information Processing Session 5B Binary Arithmetic Slide

Objectives After studying this week’s work, you should: gain insight into how the processor deals with information at the bit level Understand numbers written in binary form Be able to convert numbers from binary to decimal notation and vice-versa Be able to add numbers in binary form Slide

Bits A bit is the smallest piece of information in the computer At a single location, the information is either One - current is ON Zero -current is OFF There are no in-between states ON OFF Slide

Bytes The way that information is coded is to use a sequence of zeros and ones It is usual to have a sequence of 8 bits collected together This is called a byte Slide

Bits and Bytes Depending upon the design of the computer, there could be 4, 8 16, 32, 64 (or even more!) bits processed by the computer at once For the next few slides we will look at a simple 4-bit device. Slide

A 4-bit register Reading from the right, each bit is worth double the one preceding it. The sequence, reading from the right is: 1,2,4,8,... If we had more bits, it would continue:... 16, 32, 64, etc is ON 1 is ON Slide

Binary Numbers The register shown on the right represents the binary number 0101 This has ones in the 1 and 4 cells, and zeroes in the others. The number represented is Slide = 5

Counting in Binary Counting is an automatic process Follow the sequence... Slide

Counting in Binary A pulse enters on the right Slide

Counting in Binary To begin with the first cell was OFF It is flipped to ON Slide

Counting in Binary Another pulse enters on the right Slide

Counting in Binary The first cell was ON. It is flipped to OFF The pulse moves to the next cell on the left Slide

Counting in Binary The next cell on the left was OFF That cell is flipped to ON Slide

Counting in Binary Another pulse enters from the right Slide

Counting in Binary The first cell was OFF It is flipped to ON Slide

Counting in Binary Another pulse enters from the right Slide

Counting in Binary The first cell was ON, and is flipped to OFF The pulse moves to the second cell Slide

Counting in Binary The second cell was ON, and is flipped to OFF the pulse moves to the third cell Slide

Counting in Binary The third cell was OFF and is flipped to ON Slide

Counting in Binary Follow the sequence on the right, and try to continue it. you will see that the switching creates a pattern off ON/OFF in each column Slide

Counting in Binary The 1’s column alternates 1,0,1,0 etc. The 2’s column starts at 2 and alternates two 1’s, two 0’s The 4’s column starts at 4, and alternates four 1’s, four 0’s The 8’s column starts at 8 and alternates eight 1’s eight 0’s Slide

Decimal Numbers By decimal, we simply mean that the numbers are written in powers of ten These are 1, 10, 100, 1000, etc. So that: 352 = Slide

Binary Numbers By Binary, we mean that numbers are written in powers of two These are 1, 2, 4, 8, 16 etc. So that: = Which is = Slide

Converting Binary to Decimal Example: Reading from right to left the columns are 1,2,4,8 etc. i.e So the number in decimal notation is: = 45 Slide

How do we convert Decimal to Binary? There is a specific technique which allows us to do this. It involves repeatedly dividing a number by two and noting the remainder. Slide

Converting Decimal to Binary: An example Convert 117 to binary: 117÷ 2 = 58 remainder 1 58 ÷ 2 = 29 remainder 0 29 ÷ 2 = 14 remainder1 14 ÷ 2 = 7 remainder0 7 ÷ 2 = 3 remainder1 3 ÷ 2 = 1 remainder1 1 ÷ 2 = 0 remainder1 In binary the number is: Slide

Adding In Binary Addition in binary is a direct counterpart of what happens at the processor level. First of all we will look at a numerical example Slide

Adding in Binary There are only four possible combinations. The first three are “obvious” The last one is special (remember = 2, which is 10 in binary) = = = = 0, carry 1 Slide

Adding in Binary Adding = 2 This is 10 in Binary Put 0 in the answer, carry 1 Slide

Adding in Binary Adding = 2 This is 10 in Binary Put 0 in the answer, carry 1 Slide

Adding in Binary Adding = 3 This is 11 in Binary Put 1 in the answer, carry 1 Slide

Adding in Binary Adding Carry on with this… Slide

Adding in Binary The answer: Slide

The Binary Adder We will add 0011(3) 0110(6) Slide

The Binary Adder Starting with the end column, top cell is ON This pulse enters into the bottom cell Slide

The Binary Adder The bottom cell was OFF The pulse causes it to flip to ON Slide

The Binary Adder The next top cell was ON The pulse enters into the bottom cell Slide

The Binary Adder The bottom cell was ON The pulse flips it to OFF The pulse moves to the next cell Slide

The Binary Adder The next cell is ON The pulse flips it to OFF The pulse moves to the next cell Slide

The Binary Adder The next cell is OFF The pulse flips it to ON Slide

The Binary Adder The bottom line now reads: 1001 This is 8 + 1= 9 Slide

Bits and Bytes We have seen that a 4-bit register can count from 0 [0000] to 15 [1111] This means that it has 16 different states. Slide

Bits and Bytes Each bit in the register can be ON or OFF. This means that there are two possibilities for each cell That is, altogether 2 x 2 x 2 x 2 = 16 states Slide x 2 x 2 x 2 = 2 4

Bits and Bytes The number of possible states of registers of other sizes can be worked out in the same way For example an 8-bit register (byte) has 2x2x2x2x2x2x2x2= 2 8 = 256 different states. BitsStates , ,294,987,296 Slide

Megabits and Kilobytes A Kilobyte is 2 10 bytes. This is the nearest power of two to In fact 2 10 = 1024 A megabit is 2 20 bits. This is the nearest power of 2 to 1 million. In fact 2 20 = Slide

Other Bases Decimal and Binary are two different number bases used by the computer, but there are others An important one is Hexadecimal which has 16 separate characters: 0,1,2,3,4,5,6,7, 8,9,A,B,C,D,E,F Slide

Hexadecimal The extra letters are so that the numbers can be written using one character each. This means that A8BC is a number written in Hexadecimal. These numbers are written in base 16, so that a number like 9E means the 9 is 9 x 16 = 144 the E is 14 x 1 = 14 Altogether this would be 158 Dec Hex 0  0 1  1 2  2 3  3 4  4 5  5 6  6 7  7 8  8 9  9 10  A 11  B 12  C 13  D 14  E 15  F Slide

Summary A bit has two states, ON or OFF, which means that at the core of a computer we need to use binary coding of numbers (powers of two) Registers count and add using in binary code There are algorithms for converting decimal to binary and vice-versa Binary addition has only four possible addition pairs, and a “carrying rule” Slide