011001001111100000111001101001011111000110000111000011100000011111100000000110100111000011100001000011001 Binary Numbers 1.Binary and Denary RecapBinary.

Slides:



Advertisements
Similar presentations
Representing Numbers: Integers
Advertisements

DATA REPRESENTATION CONVERSION.
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Booth’s Algorithm.
Lecture 3 Number Representation 2 This week – Recap Addition – Addition circuitry – Subtraction of integers in binary – Representing numbers with fractional.
Number Systems Standard positional representation of numbers:
Representing Real Numbers Using Floating Point Notation Lecture 6 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Chapter 4.2 Binary numbers: Arithmetic
The Binary Number System
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Binary Number Systems.
Topic 4 Computer Mathematics and Logic
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Converting binary to decimal decimal to binary
Binary Representation and Computer Arithmetic
Dr. Bernard Chen Ph.D. University of Central Arkansas
Binary and Hexadecimal Numbers
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
The Binary Number System
Data Representation Number Systems.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Simple Data Type Representation and conversion of numbers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
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 
Computer Arithmetic Nizamettin AYDIN
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,
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Number systems, Operations, and Codes
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
1 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
Introduction to Number System
Fractions in Binary.
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
AEEE2031 Data Representation and Numbering Systems.
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
Number Systems & Operations
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Floating Point in Binary 1.Place Value Chart:
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Aim: How to write in Scientific Notation DO NOW: 1. WHAT DOES 10 5 MEAN? 2. WHAT IS THE VALUE OF USING YOUR CALCULATOR, CALCULATE 4.5 X 10 6.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Computer Number System
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
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.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in 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.
Fall’ 2014 Number System CSE Number System How Computers Represent Data Binary Numbers The Binary Number System Bits and Bytes Text Codes Binary.
Lesson Objectives Aims You should know about: Binary numbers ‘n’ that.
CS2100 Computer Organisation
Data Representation Covering… Binary addition / subtraction
Programmable Logic Controller
ITE102 – Computer Programming (C++)
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
CS1010 Programming Methodology
Binary Numbers Material on Data Representation can be found in Chapter 2 of Computer Architecture (Nicholas Carter) CSC 370 (Blum)
Hexadecimal Conversions
Digital Logic & Design Lecture 02.
A-level Computer Science
Hexadecimal.
Chapter3 Fixed Point Representation
Introduction To Number Systems
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

Binary Numbers 1.Binary and Denary RecapBinary and Denary Recap 2.HexadecimalHexadecimal 3.Binary SumsBinary Sums 4.Binary FractionsBinary Fractions

Binary and Denary Recap 1.Denary NumbersDenary Numbers 2.Binary NumbersBinary Numbers 3.Converting to DenaryConverting to Denary 4.Converting to BinaryConverting to Binary 5.QuestionsQuestions

Denary Denary is the number system we use, base 10. We have 10 possible digits, 0-9. Each digit in a number has a different place value, working from the right hand side place value increases in powers of 10. For example… with the denary number 5106 And so is made up of (5×1000)+(1×100)+(0×10)+(6×1) =

Binary Binary is the system used by electronics, i.e. a circuit is either on or off. Binary has just two possible digits, 1 or 0. Each digit in a number has a different place value, working from the right hand side place value increases in powers of 2. For example, the binary 1011 is… And so is made up of (1×8)+(0×4)+(1×2)+(1×1)=

Binary to Denary So to convert from binary to denary you add up the value of each digit. The value in denary is… (1×128) = 128 (1×64) = 64 (0×32) = 0 (0×16) = 0 (1×8) = 8 (0×4) = 0 (0×2) = 0 (1×1) = 1 Total is = Den

Denary to Binary To convert a denary number into a binary number you need to invert the processes. Divide by powers of 2 and take the whole number part of each answer (modular division). For example, to get the number 234 in binary… 234 ÷ 128 = 1 remainder ÷ 64 = 1 remainder ÷ 32 = 1 remainder ÷ 16 = 0 remainder ÷ 8 = 1 remainder 2 2 ÷ 4 = 0 remainder 2 2 ÷ 2 = 1 remainder 0 0 ÷ 1 = 0 remainder 0 Therefore, the binary number is

Questions Some questions

Hexadecimal 1.Hexadecimal NumbersHexadecimal Numbers 2.Why Use HexadecimalWhy Use Hexadecimal 3.Converting to BinaryConverting to Binary 4.Converting from BinaryConverting from Binary 5.Reference TableReference Table 6.QuestionsQuestions

Hexadecimal Numbers In hexadecimal (hex for short) we have 16 different digits, 0-9 (like denary) and then an additional 6 digits. We use letters of the alphabet to represent these additional digits. In hex place value increases in powers of 16. For example, the hex number C3… Is calculated as =(0×256)+(C×16)+(3×1) =(0×256)+(12×16)+(3×1) = C3

Why use Hexadecimal? Hexadecimal numbers allow for larger numbers to be stored in the same number of bits. This makes hex more efficient as well as easier to read than binary. For example, to store the number 255 in binary requires eight digits ( ), in denary it requires three digits, whilst in hex it requires only two (FF) Each hex digits requires one nibble (four bits) to store in the computer’s binary memory.

Converting to Binary To convert to binary… Each hex digit must be individually converted into a denary number. That denary number is then converted into a four bit binary number. For example… To convert the number 5B into binary 5  5 in denary  0101 in binary B  11 in denary  1011 in binary Therefore, 5B is shown as in binary.

Converting from Binary To convert back from binary into hex you can split the binary number into nibbles (blocks of four bits), starting from the right hand side. You then convert each nibble into its denary equivalent, and then into a single hex digit. For example, to convert the number into hex… 1101  13 in denary  “D” 1011  11 in denary  “B” Therefore, the hex conversion is “DB”

Reference Table… DenaryBinaryHex DenaryBinaryHex A B C D E F

Questions Some questions

Binary Sums 1.AdditionAddition 2.Negative BinaryNegative Binary 3.More Negative BinaryMore Negative Binary 4.SubtractionSubtraction 5.QuestionsQuestions

Binary Addition You add binary numbers just like denary ones, remembering that = = = 10 (or 0, and carry the 1) For example… Therefore, the answer is

Negative Binary Numbers In binary a negative number is represented with a sign bit, this is the MSB (most significant bit). If the MSB is a 1, then the number is negative. To convert a number into its negative equivalent, Take the positive number in binary form Invert all the digits, so 1 becomes 0 and 0 becomes 1. Now add one to the resulting number. For example, negative 6 would be shown as -6    1010

An Easier Method… A simpler way of converting a positive to a negative is to follow this method… Starting from the right (least- significant bit, LSB) Leave all the digits up to and including the first ‘1’ alone. Invert all the remaining digits. For example, negative 6 in binary is  Leave the Leave the Invert to a Invert to a The answer

Binary Subtraction All a processor is capable of is binary addition, all other operations can be expressed in terms of addition. Subtraction is the result of adding a negative number, so to do the sum 6 – 4, you do 6 PLUS negative 4. For example… = 108 – 53 = – = =

Questions Some questions…

Binary Fractions 1.Fixed PointFixed Point 2.Floating Point in DenaryFloating Point in Denary 3.Floating Point in BinaryFloating Point in Binary 4.Converting from Floating PointConverting from Floating Point 5.Negative Floating PointNegative Floating Point 6.NormalizationNormalization 7.Normalized BinaryNormalized Binary 8.QuestionsQuestions

Fixed Point Fractions With binary fractions place value still varies by powers of two. In fixed point binary the decimal place is fixed as being after a certain amount of digits. For example, where the binary point is fixed after four digits, the number has a value of.. = (1×8 ) + (1×1) + (1×0.5) + (1×0.0625) = = /21/2 1/41/4 1/81/8 1 /

Understanding Floating Point Fractions in Denary Floating point fractions are the equivalent of Scientific Notation in denary. In Scientific Notation you have a sign, a mantissa and an exponent. For example, × 10 4 ‘-’ is the sign ‘0.65’ is the mantissa ‘4’ is the exponent The number is raised to the power 10, since we are in denary.

Understanding Floating Point Fractions In Binary Typically 16 bits might represent a binary floating point value. The first 10 bits represent the mantissa, and the last 6 the exponent. For example ‘0’ is the sign of the mantissa ‘ ’ is the mantissa ‘000111’ is the exponent The number is raised to the power 2, since we are in binary.

Converting From Floating Point To convert into denary… 1.Convert the exponent into its decimal form  = 7 2.Consider that the mantissa is preceded by a decimal point, move that decimal point exponent times to the right  Now convert that value into denary, remembering that bits after the decimal point are negative powers and therefore fractions. Don’t forget the sign bit! 

Negative Floating Point Where the sign bit is negative, the overall number is negative. –For example… = × = = Where the exponent is negative, rather than moving the decimal point to the right, you move it to the left. –For example… = × = × = =

Normalization To be memory efficient all floating point numbers should be normalised. A normalised number can only be displayed in one way. –For example in strict scientific notation 300 can only be shown as 0.3×10 3 –However using a looser notation it could be shown as 300×10 0, 30×10 1, etc. In normalized binary, the first bit of the mantissa after the sign bit should always be a 1.

Normalized Binary To Normalize a binary number… 1.Write the mantissa with the assumed decimal point in place. 2.Shift the decimal point until it reaches the first 1. 3.Subtract the number of places moved from the exponent. For example… Normalize We moved the point 3 places, therefore we subtract 3 from the exponent of 2 (2 - 3 = -1)

Questions Some questions