Integer Real Numbers Character Boolean Memory Address CPU Data Types

Slides:



Advertisements
Similar presentations
ECE 331 – Digital System Design
Advertisements

Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
Chapter 2 : Number System
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Decimal Addition What is going on? (carry) (subtract the base)
ECE 301 – Digital Electronics Course Introduction, Number Systems, Conversion between Bases, and Basic Binary Arithmetic (Lecture #1)
1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
Simple Data Type Representation and conversion of numbers
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
How Computers Work Dr. John P. Abraham Professor UTPA.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Binary Arithmetic & Data representation
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Supplemental Chapter Number Bases
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
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,
Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in other bases.
Number systems, Operations, and Codes
Introduction to Computing Dr. Nadeem A Khan. Lecture 10.
Binary Values and Number Systems
Positional Notation 642 in base 10 positional notation is:
Number Base Conversions
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Arithmetic Chapter 4 Subject: Digital System Year: 2009.
Computer Organization 1 Data Representation Negative Integers.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
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.
973cs111_add_posneg.ppt Integers Whole numbers Do NOT contain decimal points (as in money) 43,689 is an integer 43, is NOT an integer (it is floating.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Binary Values and Number Systems
Unit 1 Introduction Number Systems and Conversion.
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Integer Rules Memorize the Rules.
Chapter 02 Nell Dale & John Lewis.
Introduction to Computing
Digital Systems and Number Systems
Data Representation Binary Numbers Binary Addition
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
Number Systems.
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Numbering Systems and Arithmetic operations on Hex, binary, and octal
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Electronics and Microprocessors
Digital Logic Design (CSNB163)
Binary Values and Number Systems
Number Representation
ECE 301 – Digital Electronics
CPS120: Introduction to Computer Science
Chapter 6: Computer Arithmetic
Binary Values and Number Systems
CSC 220: Computer Organization Signed Number Representation
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
OBJECTIVES After reading this chapter, the reader should be able to :
Binary Values and Number Systems
Presentation transcript:

Integer Real Numbers Character Boolean Memory Address CPU Data Types Chapter 3 Integer Real Numbers Character Boolean Memory Address

Integer Integer Whole numbers No decimal places Unsigned integers Use entire by ( 8 or 6 bits) for number Lowest number is zero (0) Signed integers Use high order bit for + or – sign Octal machines have 5 bits for number (out of 6) Excess notation Hex machines have 7 bit for number (out of 8) Excess notation

Octal Integer 6 BIT number X X X X X X Weight value 32 16 8 4 2 1 All positions = “1” (“ON”) 1 1 1 1 1 1 32 16 8 4 2 1 ----- 63 Not counted: used for sign 16 8 4 2 1 ----- 31 Unsigned Signed

Hexadecimal Integer 8 BIT number X X X X X X X X Weight value 128 64 32 16 8 4 2 1 All positions = “1” (“ON”) 1 1 1 1 1 1 1 1 128 64 32 16 8 4 2 1 ----- 255 Not counted: used for sign 64 32 16 8 4 2 1 ----- 127 Unsigned Signed

Arithmetic Operations Addition Subtraction Multiplication Division

Add two numbers Addition Decimal Binary Binary bit weights 6 0110 1 + 2 + 8 = 1110 + 5 0101 ---- ------- 1110 10112

Subtract two numbers Subtraction ? Answer is: 6 - 5 ----- 0 Decimal Binary Binary bit weights 6 0110 1 + 0 + 0 + 0 = 110 - 5 - 0101 * ---- ------- 110 00002 ? 1 2 3 4 0110 -0101 ------- Borrow 1 from 2s position add to 1s position 0101 -0101 ------- Subtract 1s position 0101 -0101 ------- 0 Subtract 2s position 0101 -0101 ------- 00 5 6 7 Answer is: 6 - 5 ----- 0 Subtract 4s position 0101 -0101 ------- 000 Subtract 8s position 0101 -0101 ------- 0000

Complements Binary numbering scheme Ones (1) become zero (0) Zeros (0) become ones (1) Octal Hexadecimal 0 000 = 111 0000 = 1111 1 001 = 110 0001 = 1110 2 010 = 101 0010 = 1101 3 011 = 100 0011 = 1100 4 100 = 011 0100 = 1011 5 101 = 010 0101 = 1010 6 110 = 001 0110 = 1001 7 111 = 000 0111 = 1000 8 1000 = 0111 9 1001 = 0110 A 1010 = 0101 B 1011 = 0100 C 1100 = 0011 D 1101 = 0010 E 1110 = 0001 F 1111 = 0000

Computers MULTIPLY, SUBTRACT and DIVIDE by ADDITION Two’s Complement Computers MULTIPLY, SUBTRACT and DIVIDE by ADDITION Binary numbering scheme Used to work with negative numbers Ones (1) become zero (0) Zeros (0) become ones (1) Data is signed if: Variable data type was defined as signed in the program The number is converted in the program The computer does a Subtract or Divide Formula for conversion Original binary number Compliment the number Ones to Zeros Zeros to Ones Add binary one to lowest position High order carry's are discarded

Add two numbers Two’s Complement Decimal Binary Binary bit weights 6 0110 1 + 2 + 8 = 1110 + 5 0101 ---- ------- 1110 10112

* Two’s Compliment of 5 Subtract two numbers Two’s Complement Decimal Binary Binary bit weights 1 1 6 0110 1 + 0 + 0 + 0 = 110 - 5 +1011 * ---- ------- 110 00012 * Two’s Compliment of 5 5 = 0101 Original Compliment 1010 Add one 1 -------- Two’s compliment 1011

Subtraction Division Addition and Two’s Compliment Summary Computers do Subtraction And Division Using Addition and Two’s Compliment