CDP ECE 291 -- Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463.

Slides:



Advertisements
Similar presentations
ICS312 Set 2 Representation of Numbers and Characters.
Advertisements

Representing Numbers: Integers
DATA REPRESENTATION CONVERSION.
The Binary Numbering Systems
Lecture - 2 Number systems and computer data formats
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation Computer Organization &
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
Data Representation in Computers
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Number Systems Computer Science 210 Computer Organization.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Simple Data Type Representation and conversion of numbers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
Data Representation – Binary Numbers
Computers Organization & Assembly Language
Numbering Systems CS208.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Chapter 3 Data Representation
Data Representation and Computer Arithmetic
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Number Systems Spring Semester 2013Programming and Data Structure1.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
ECE 331 – Digital System Design
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Number systems, Operations, and Codes
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
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.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
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.
Data Representation, Number Systems and Base Conversions
AEEE2031 Data Representation and Numbering Systems.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
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=
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
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.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
CS2100 Computer Organisation
Computer Science 210 Computer Organization
Number Representation
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Number Systems.
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
Number Systems.
CS1010 Programming Methodology
Data Representation in Computer Systems
Computer Science 210 Computer Organization
Presentation transcript:

CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463 CSRL

CDP ECE Spring 2000 Number Systems - Review ECE 290!! Decimal numbers (or base 10 system) - Notation: 0,1,…9: –Example: 378 = 3 * * * 10 0 Binary numbers (or base 2 system) - Notation: 0 and 1: –Example: (001101) 2 = 1 * * * * 2 0 = 8+4+1=(13) 10 Hexadecimal numbers (or base 16 system) - Notation: 0..9,A,B,C,D,E,F: –Example: 52A4F = 5* * * * *16 0 Many other representations –BCD (Binary Coded Decimal): decimal numbers represented in binary notation with each decimal digit represented by its 4-bit binary encoding: Example: 728 in BCD is

CDP ECE Spring 2000 Base Conversion Always easy to convert from any base b to decimal: just compute the sum of products - result is in decimal. Converting from decimal to base b: Successive division or (remainder) decimal with the largest power of b - successive quotients form base b representation. –Example: Convert 77 to binary representation. Divide 77 by 64 (2 6 ) - Q = 1 R=13 Divide 13 by 8 (2 3 ) - Q = 1 R=5 Divide 5 by 4 (2 2 ) - Q = 1 R=1 Divide 1 by 1 (2 0 ) - Q = 1 R=0 --- DONE –Result: 77 = –Put 1’s where Q=1 and 0’s in the remaining positions

CDP ECE Spring 2000 Converting Fractional Part 1- Multiply fraction with base 2- Save integer digit (if any) 3- Repeat until remainder=0 or accuracy is obtained 4- The successive digits form the converted fractional representation –Example: Converting.173 to octal representation.173 X 8 = Save X 8 = Save X 8 = Save 0 –.173 in base 10 =.130… octal

CDP ECE Spring 2000 Radix-1 & Radix Complement Representation One’s complement representation: –Subtract n-bit binary representation from n-bit all 1’s (radix-1) Two’s complement representation: –As in One’s complement + add 1 to the result (radix) One of the problem with (radix-1) complement representation is inability to uniquely represent zero. Two’s complement gives you the inverted (negated) number: if you add a number and its (radix) complement discarding any overflow, the result is ZERO!

CDP ECE Spring 2000 Signed & Unsigned Representations First bit in binary rep. is sign bit: –s=0: positive (+) –s=1: negative (-) Two quick schemes to represent a negative number N (any of them will work): –Invert all bits then add 1 (2’s complement) –Scan N from right to left: copy 0’s, copy first 1, invert the rest Sign-extending a number: copy sign bit into extra leftmost positions

CDP ECE Spring 2000 Memory Objects & Data Types Data Types Numbers bit (eg: 1) nibble = 4 bits DB:byte = octet = 8 bits DW:Word = 2 bytes = 16 bits (80x86 terminology) DD:DoubleWord = 4 bytes = 32 bits (80x86 terminology) Intel uses little endian format (i.e., LSB at lower address) Signed Integers (2's complement)

CDP ECE Spring 2000 Memory Objects (Cont.) Text Letters and characters (7-bit ASCII standard) 'A'=65=0x41 Extended ASCII (8-bit) allows for extra 128 graphics/symbols) Collection of characters = Strings Collection of Strings = Documents Programs Commands (MOV, JMP, AND, OR, NOT) Collections of commands = procedures/functions/subroutines Collection of subroutines = programs

CDP ECE Spring 2000 Memory Objects (Cont.) Floating point numbers (covered later) Images (GIF, TIF, JPG, BMP) Video (MPEG, QuickTime, AVI) Audio (voice, music)