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.

Slides:



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

Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Representations Example: Numbers –145 –CVL – –91 –
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Number Representation (1) Fall 2005 Lecture 12: Number Representation Integers and Computer Arithmetic.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
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.
CSE20 Lecture 3 Number Systems: Negative Numbers 1.Sign and Magnitude Representation 2.1’s Complement Representation 3.2’s Complement Representation 1.
Number System and Codes
Introduction to Number Systems
Computer Systems 1 Fundamentals of Computing
COE 202: Digital Logic Design Number Systems Part 1
CS1800 Summer 2014 Binary Numbers. Decimal Integers  What does a decimal number like "87294" really mean?  More generally.
Chapter 1 1 Number Systems. 2 Objectives  Understand why computers use binary (Base-2) numbering.  Understand how to convert Base-2 numbers to Base-
Number Systems Computer Science 210 Computer Organization.
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
3. Representing Integer Data
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Binary Representation - Shortcuts n Negation x + x = 1111…1111 two = -1 (in 2’s complement) Therefore, -x = x + 1 n Sign Extension o Positive numbers :
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
Calculating Two’s Complement. The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of.
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
46 Number Systems Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
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 2: The Logic of Compound Statements 2.5 Application: Number Systems and Circuits for Addition 1 Counting in binary is just like counting in decimal.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
Number systems, Operations, and Codes
Positional Number Systems
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
Positional Notation 642 in base 10 positional notation is:
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
Octal to Decimal Hexadecimal DecimalOctal Binary.
AEEE2031 Data Representation and Numbering Systems.
By Jariya Phongsai A two's-complement system is a system in which negative numbers are represented by the two's complement of the absolute value; this.
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
Addition and Substraction
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
Computing Machinery Chapter 6: Computer Arithmetic.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Lecture 2 Binary Arithmetic Topics Terminology Fractions Base-r to decimal Unsigned Integers Signed magnitude Two’s complement August 26, 2003 CSCE 211.
69 Decimal (Base 10) Numbers n Positional system - each digit position has a value n 2534 = 2*1, * *10 + 4*1 n Alternate view: Digit position.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
NUMBER SYSTEMS.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
IT1004: Data Representation and Organization Negative number representation.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Computer Organization 1 Data Representation Negative Integers.
Lecture 2: 8/29/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
CSC 110 – Intro to Computing Lecture 3: Converting between bases & Arithmetic in other bases.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Lecturer: Santokh Singh
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
Data Representation Integers
CSE 102 Introduction to Computer Engineering
Binary / Hex Binary and Hex The number systems of Computer Science.
Chapter 6: Computer Arithmetic
Presentation transcript:

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 determine the values they represent. In base-10 each successive digit (reading from right to left) is worth ten times the previous position. In modern computers numbers are represented in base-2. This means that 0 and 1 are the only digits permitted and each position in a multi-digit number is worth two time the previous position. Positional Notation = 9(100) + 4(10) = 1(32) + 1(16) + 0(8) + 1(4) + 0(2) + 1 = 53 10

Binary, Octal, and Hexadecimal Numbers Base 2 (binary), base 8 (octal), and base 16 (hexadecimal) are all powers of 2 bases so it is easy to convert between them. Base 2 – digits 0,1 Base 8 – digits 0,1,2,3,4,5,6,7 Base 16 – digits 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F ABCDEF ABCDEF binary octal hexadecimal B A 2 A F 0 A B decimal we can convert from base 2 to base 8 by evaluating groups of 3 bits at a time we an convert from base 2 to base 16 by evaluating groups of 4 bits at a time base 2 base 8 base 16 A single binary digit is called a bit. Eight bits is called a byte, four bits is called a nibble.

Converting Between Base 10 and Base 2 Let’s convert 142 to base 2 142/2 = 71 remainder 0 71/2 = 35 remainder 1 35/2 = 17 remainder 1 17/2 = 8 remainder 1 8/2 = 4 remainder 0 4/2 = 2 remainder 0 2/2 = 1 remainder 0 1/2 = 0 remainder Let’s convert to base 10 1 = 1 10 = 2x1 = = 2x2 + 1 = = 2x5 + 1 = = 2x11 = = 2x22 = = 2x = = 2x89 = = 2x = Left to Right Evaluation

Base 2 Arithmetic optional Addition Converting a Number to Two’s Complement* *Two’s complement is a special way to represent negative values for base-2 integers this is the base 2 representation for 29 flip all the bits add 1 this is the two’s complement representation for Subtraction ignore overflow this is 123 this is -29 this is 94 When the binary value has a leading 1, the number is negative...to find the magnitude of this value we need to take the two’s complement again. Lets add -29 to most significant digit a 1 means values is negative magnitude is 17 so = -17