Numbers and Number Systems

Slides:



Advertisements
Similar presentations
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
Advertisements

Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation Computer Organization &
Data Representation COE 205
Text Representation within Computers CS208. The Binary Digit (Bit) One bit can encode a value set that contains two elements e.g. {black, white}, {up,

Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Number Representation (1) Fall 2005 Lecture 12: Number Representation Integers and Computer Arithmetic.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Data Representation in Computers
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Data Representation 3 This week – Recap on Floating point number – ASCII – unicode.
Introduction to Information Technology
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Number Systems Computer Science 210 Computer Organization.
Simple Data Type Representation and conversion of numbers
Lecture 5.
Computers Organization & Assembly Language
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
Binary Arithmetic & Data representation
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.
Fill in the blanks: (1) _________ has only two possible values 0 and 1. (2) There are __________bits in a byte. (3) 1 kilobyte of memory space can store.
Number Systems Spring Semester 2013Programming and Data Structure1.
Cis303a_chapt03-2a.ppt Range Overflow Fixed length of bits to hold numeric data Can hold a maximum positive number (unsigned) X X X X X X X X X X X X X.
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 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
What is a computer? A computer is a device that:
The Hexadecimal Number System and Memory Addressing ISAT 121.
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.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
1 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
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.
Number Systems and Digital Codes
Data Representation, Number Systems and Base Conversions
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Data Representation.
Systems Architecture, Fourth Edition 1 Data Representation Chapter 3.
Binary Arithmetic, ASCII, & Boolean Algebra
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
Understanding 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.
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.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Computer Science 210 Computer Organization
Understanding binary Understanding Computers.
Number Representation
3.1 Denary, Binary and Hexadecimal Number Systems
CSCI 198: Lecture 4: Data Representation
Data Transfer ASCII FILES.
CSCI 161: Lecture 4: Data Representation
Computer Science 210 Computer Organization
Information Representation
C1 Number systems.
Chapter Four Data Representation in Computers By Bezawit E.
Chapter 3 - Binary Numbering System
Presentation transcript:

Numbers and Number Systems Instructor : Eng. Haya Sammaneh

Introduction Real World Data Computer Data Input device Dear Mom: Keyboard 10110010… Digital camera 10110010…

Number Systems Decimal -- 10 symbols (0,1,2,3,4,5,6,7,8,9) Binary -- 2 symbols (0,1) Octal -- 8 symbols (0,1,2,3,4,5,6,7) Hexadecimal -- 16 symbols (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F) , A = 10 , B = 11 ….F = 15

Converting with fraction, examples Binary to Decimal Ex: (1101.1)2  1*23 + 1*22 + 0*21 + 1*20 + 1*2-1 = (13.5)10 Octal to Decimal Ex: (673)8  6* 82 + 7*81 + 3*80 = (443)10 Hexadecimal to Decimal Ex. (A9C)16  A* 162 + 9*161 + C * 160= 10* 162 + 9*161 + 12 * 160 =(2788)10

Converting, example Binary to Octal Ex: (011011.101100)2(33.54)8 Binary to Hexadecimal Ex: (11111011.11011000)2(FB.D8)16 Hexadecimal to Binary Ex. (A3.B)16  (10100011.1011)2

Converting, example Decimal to Binary EX: (12.3)10  (1100.01001)2 12 / 2 = 6 ( Remainder 0 (right) ) 6 / 2 = 3 ( Remainder 0 ) 3 / 2 = 1 ( Remainder 1 ) 1 / 2= 0 ( Remainder 1 (left)) 0.3 * 2 = 0.6 (left) 0.6 * 2 = 1.2 0.2 * 2 = 0.4 0.4 * 2 = 0.8 0.8 * 2 = 1.6 (right) Using the same method to convert the Decimal number to any base.

Signed Numbers In general a N-bit integer can store numbers in the range of -2N-1 -1 to 2N -1

Ways to represent negatives Negative integers are stored via two’s complement representation 1’s complement reverse the bits to get the negative Ex: 1101  1’s complement  0010 2’s complement It happens by reversing the bits (1’s complement) then adding 1. Ex: 1101  2’s complement  0011 Get 1’s complement  0010 then add 1  0011

Binary arithmetic – addition and multiplication 0 + 0 = 0 0 + 1 = 1 Overflow: If there is not enough room to hold the result correctly. If the two numbers are of opposite signs, no overflow can occur. (Why not?) multiplication 0 * 0 = 0 0 * 1 =0 1 * 0 = 0 1 * 1 = 1 1 + 0 = 1 1 + 1 = 0 and carry 1 (Result is smaller than one of them)

Concepts of bit, byte and word Bit is the smallest data item in computers (short for "binary digit" . Each data item, or bit, can assume either the value 0 or the value 1. Computer circuitry performs various simple bit manipulations, such as examining the value of a bit, setting the value of a bit and reversing a bit (from 1 to 0 or from 0 to 1). Bytes are composed of eight bits which is the smallest grouping of numbers . Large amounts of memory are indicated in terms of kilobytes (1,024 bytes), megabytes (1,048,576 bytes), and gigabytes (1,073,741,824 bytes). Words: The size of a word varies from one computer to another, depending on the CPU. For computers with a 16-bit CPU, a word is 16 bits (2 bytes). On large mainframes, a word can be as long as 64 bits (8 bytes) or 128 bit (16 byte). Some computers and programming languages distinguish between short-words and long-words. A short-word is usually 2 bytes long, while a long-word is 4 bytes.

Standard Alphanumeric Formats Problem : Representing text strings, such as “Hello, world”, in a computer The standards for representing letters (alpha) and numbers ASCII – American standard code for information interchange Unicode

Character Code :ASCII and Unicode Why do computers use numbers for the names of letters? Because they store all information in number form. Technical detail: they store information as ‘bytes’; each ‘byte’ consists of 8 ‘bits’; each ‘bit’ is either the number ‘0’ or ‘1’’

Character Code :ASCII and Unicode ASCII and Unicode are two computer ‘languages’ for naming letters The ASCII name for ‘a’ is ‘61’ The Unicode name for ‘a’ is ‘U+0061’

ASCII Reference Table Control , Numeric, Alphabetic, Punctuations Codes MSD LSD 1 2 3 4 5 6 7 NUL DLE SP @ P p SOH DC1 ! A Q a W STX DC2 “ B R b r ETX DC3 # C S c s EOT DC4 $ D T d t ENQ NAK % E U e u ACJ SYN & F V f v BEL ETB ‘ G g w 8 BS CAN ( H X h x 9 HT EM ) I Y i y LF SUB * : J Z j z VT ESC + ; K [ k { FF FS , < L \ l | CR GS - = M ] m } SO RS . > N ^ n ~ SI US / ? O _ o DEL 7416 111 0100

ASCII Most widely used coding scheme Computer systems can represent up to 256 letters Technical detail: with one 8-bit byte (28 = 256) ASCII only uses 7 bits (27 = 128) The first 32-127 are called ASCII letters (characters) 1-32: That’s for control characters like the ‘option’ key.

ASCII Problem No one agrees on what letters the numbers 128-256 stand for.

Unicode: fixing the ASCII problem Most common 16-bit form represents 65,536 characters. Multilingual: These characters cover the principal written languages of the Americas, Europe, the Middle East, Africa, India, Asia, and Pacifica.