Data Types and Information Representation 9-11-2002.

Slides:



Advertisements
Similar presentations
Representing Numbers: Integers
Advertisements

DATA REPRESENTATION CONVERSION.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Level ISA3: Information Representation
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 =
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Decimal Addition What is going on? (carry) (subtract the base)
1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.
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.
Introduction to Number Systems
Computer Systems 1 Fundamentals of Computing
Binary Arithmetic Math For Computers.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Dr. Bernard Chen Ph.D. University of Central Arkansas
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 :
Number Systems.
Newport Math Club Copyright © 2009 by Newport Math Club.
Numbers and number systems
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Numbering systems.
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
IT253: Computer Organization
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 What is the Standard Base we
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,
1 Week 2: Binary, Octal and Hexadecimal Numbers READING: Chapter 2.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system.
The Hexadecimal Number System and Memory Addressing ISAT 121.
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
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.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
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.
Hexadecimal. Overview Hexadecimal (hex) ~ base 16 number system Use 0 through 9 and... A = 10 B = 11 C = 12 D = 13 E = 14 F = 15.
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
Data Representation Bits, Bytes, Binary, Hexadecimal.
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
Addition and Substraction
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
1 4. Computer Maths and Logic 4.1 Number Systems.
NUMBER SYSTEMS.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
COMPUTER PROGRAMMING I Objective 1.02 Understand Numbering Systems.
Lecture 2: 8/29/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Number Representation 1 Lecture 2. Outcomes By the end of the session you should: – Understand what bits/bytes/words are. – Understanding conversion between.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Numbering Systems and Conversion Understand How Computing Devices Work 1.
Two’s Complement The language of machines, part II.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
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:
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Cosc 2150: Computer Organization
Lecturer: Santokh Singh
Introduction To Number Systems
Digital Design Chapter One Digital Systems and Binary Numbers
What is a byte? What is it? How would you use it?
Integer Real Numbers Character Boolean Memory Address CPU Data Types
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Objective 1.02 Understand Numbering Systems
Presentation transcript:

Data Types and Information Representation

Opening Discussion zWhat did we talk about last class? zDo you have any questions about the assignment? Are there any significant problems that people are running into? zWho can describe the decimal number system that we use?

Computer Information 0/1 zAs you know, computers store everything as a series of bits where each bit can be on or off, we represent this as 1 or 0. zTerms yByte - 8 bits yWord, HalfWord, and Dword - Varies by machine, but today a “standard word” would be considered to have 32 bits in it. yNibble - Half a byte. This is never used now.

Binary Numbers zYou are used to the decimal number system where we have 10 digits, 0-9, and each digit going left represents groupings 10 times larger that the previous digit. y1, 10, 100, 1000,... zIn binary the same is true, but the base is 2 so we have only two digits and it position goes up by a factor of two. y1, 2, 4, 8, 16, 32, 64, …

Conversion to and from Binary zTo convert to binary you begin by finding the largest power of two that is smaller than the number. Put a one in the digit for that power, subtract it from the number and repeat. y29=16+13=16+8+5= =11101 zTo get back to decimal just add up the values of the powers of 2 where the bit is one.

Hexadecimal Numbers zAlso common when working with computers are hex numbers. These us a base 16 number system which has 0-9 and A-F. The same general rules apply. zBecause 16 is a power of 2 we can easily convert between the two by grouping bits into groups of =0, 0001=1, 0010=2, … 1110=E, 1111=F. zEach hex digit is a nibble and two make a byte.

Octal Numbers zYou will also occasionally see numbers in base-8 as well. Again we have a power of 2, but now the bits are grouped by 3.

Binary Addition zAdding in binary is pretty easy, even easier than in decimal. zYou can write the numbers one above the other and perform “long addition” with carrying. If both have a zero the result is zero. If one has a one, the result is one. If both have a one, the result is zero and you carry one to the next digit. zLet’s look at small examples.

Negative Values zHow do we represent a negative value when we have only 0/1? Your book mentions a sign bit, that isn’t really how it is done with integers for many reasons. zInstead, we use what is called 2s compliment numbers. The idea is that a number plus its negation should always equal zero. zLet’s explore this idea on a 4 bit number.

Minute Essay zConvert 187 to binary then write it as a hex number and an octal number. Remember the shortcuts for the last two. zAssignment #1 is due by the end of today. I have received submissions from many of you. I’m guessing that they don’t take all that long once you start them. zQuiz #1 is Friday.