Review Binary Basic Conversion Binary1286432168421Decimal 7 0110 001001100010 38 1101 000111010001 129 1010 10101010 182 0000 111100001111 255.

Slides:



Advertisements
Similar presentations
Representing Numbers: Integers
Advertisements

EMB1006 The Binary System There is no 2 Jonathan-Lee Jones.
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 –
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
Mathematics with Binary. Question  Below is a binary string  Which is the least significant bit (LSB)?  Which is the most significant bit (MSB)? 0.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
3. Representing Integer Data
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Computer Systems 1 Fundamentals of Computing Negative Binary.
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
The Binary Number System
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Computer Science 111 Fundamentals of Programming I Number Systems.
Computer Architecture
Data Representation - Part I. Representing Numbers Choosing an appropriate representation is a critical decision a computer designer has to make The chosen.
CSE 111 Representing Numeric Data in a Computer Slides adapted from Dr. Kris Schindler.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
Number Representation. 10/12/2015CDA31002 Conversion between Representations Now we can represent a quantity in different number representations How can.
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
BR 8/99 Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to 255.
Number Representation
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.
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)
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
INEL 4215: Computer Architecture and Organization Number Systems Signed numbers.
1 Review on Number Systems Decimal, Binary, and Hexadecimal.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463.
Sep 29, 2004Subtraction (lvk)1 Negative Numbers and Subtraction The adders we designed can add only non-negative numbers – If we can represent negative.
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
Two’s Complement. A system used to represent a negative number in binary A system used to represent a negative number in binary Positive numbers start.
Addition and Substraction
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
1 Number Systems Decimal, Binary, and Hexadecimal.
Floating Point Binary A2 Computing OCR Module 2509.
IT1004: Data Representation and Organization Negative number representation.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
1 COMS 161 Introduction to Computing Title: Computing Basics Date: September 8, 2004 Lecture Number: 7.
Reasons to  Binary With Mrs
In decimal we are quite familiar with placing a “-” sign in front of a number to denote that it is negative The same is true for binary numbers a computer.
ECE 3110: Introduction to Digital Systems Number Systems: signed numbers.
Computer Organization 1 Data Representation Negative Integers.
Number Representation 1 Lecture 2. Outcomes By the end of the session you should: – Understand what bits/bytes/words are. – Understanding conversion between.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Two’s Complement The language of machines, part II.
Number Systems Part 2. Counting in Binary DecimalBinary
Software Design and Development Storing Data Computing Science.
Binary Arithmetic James A. Rome Tennessee Governor's Academy August 2010.
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Negative Numbers and Subtraction
Negative Binary Numbers
Negative Binary Numbers
Subtraction The arithmetic we did so far was limited to unsigned (positive) integers. Today we’ll consider negative numbers and subtraction. The main problem.
Binary to Decimal Conversion
Presentation transcript:

Review Binary Basic Conversion Binary Decimal

Review Binary Conversion of decimals Decimal

Review Binary Conversion of non-standard decimals ◦Note: Remember to convert the whole number separately NumberWhole Number Part number 0.22x 2 = NumberWhole Number Part number 1.15x 2 = Solution:

Binary 2 NEGATIVE NUMBERS

bits Each 0 or 1 is a bit of information Bit = binary digit A bit is a single piece of information A nibble is 4 bits of information A byte is 8 bits of information A word refers to a string of bits used is a process by a computer. Eg. A computer might work in 8, 16 or 32 bit words.

bits When we talk about representing a number using 5 bits, it means we have five 0’s and 1’s (9) In binary we’ll typically work with 8 bits (65) As they are strings of bits, we might refer to any of these as a ‘word’ ◦A 5-bit word ◦An 8-bit word

bits In representing a number there are bits that are sometimes referred to as: ◦Most Significant bit ◦Least Significant bit Most significant bit ◦Left most bit ◦In the position for the largest value number Least significant bit ◦Right most bit ◦In the position for the lowest value number Most significant bit – value 16 Least significant bit – value 1

What about negative numbers? How might we represent negative numbers using only 0s and 1s? Let’s consider... ◦Unsigned Binary ◦Sign & Magnitude ◦Two’s Complement

Unsigned Binary This is binary in the format we have already dealt with ◦Deals with positive numbers only ◦No extra bits

Sign and Magnitude Sometimes referred to as signed binary Deals with positive and negative numbers Reserves a bit (the most significant bit) as a ‘sign bit’ Sign bit is used to indicate a positive number (0) or a negative number (1) is + 5 (positive) is - 5 (negative)

Sign and Magnitude Using Sign and Magnitude (with 1 sign bit, and 7 bits for the number), convert the following numbers BinaryDecimal

Sign and Magnitude Using Sign and Magnitude, convert the following numbers BinaryDecimal

Two’s Complement Two’s complement is also used to represent positive and negative numbers. It does not use a sign bit, however the most significant bit does act as an indicator for the sign of the number The two’s complement of a number is the negative representation of a number

Two’s Complement ‘Taking a two’s complement’ means getting the negative representation of a number The easiest way to do this: ◦Start with the positive representation of the number ◦Start from the right most bit and work towards the left ◦Any ‘0’ bits remain the same until the first ‘1’ bit ◦Keep the first ‘1’ bit as a 1 ◦Change every other bit to its opposite (1  0 and 0  1)

Two’s Complement – Start with the positive representation of the number – Start from the right most bit and work towards the left – Any ‘0’ bits remain the same until the first ‘1’ bit – Keep the first ‘1’ bit as a 1 – Change every other bit to its opposite (1  0 and 0  1) 6 is  

Two’s complement Follow the steps to determine the 8-bit two’s complement representation of -5 and -10 OriginalBinary Representation Two’s ComplementNew Value 5 10

Two’s complement Follow the steps to determine the 8-bity two’s complement representation of -5 and -10 OriginalBinary Representation Two’s ComplementNew Value

Two’s Complement Important Note!!! You only need to ‘take the two’s complement’ if ◦the number is negative, or ◦the number needs to be subtracted Always start with more bits than you require to represent the number. ◦Eg. 4 can be represented using just 3 bits, to complete two’s complete accurately you must work with at least 4 bits or more