The Hexadecimal Number System and Memory Addressing ISAT 121.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
ICS312 Set 2 Representation of Numbers and Characters.
HEXADECIMAL NUMBERS Code
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation Computer Organization &
Data Representation COE 205
Level ISA3: Information Representation
Introduction to Programming with Java, for Beginners
Binary and Hexadecimal Numbers
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Assembly Language for Intel-Based Computers, 4th Edition
Number Representation (1) Fall 2005 Lecture 12: Number Representation Integers and Computer Arithmetic.
Computer Systems 1 Fundamentals of Computing
© Copyright 2000 Indiana University Board of Trustees Proficiency Quiz Study Guide Note: The following slides are provided courtesy of Dr. Bob Orr (Computer.
Information Representation and Number Systems BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
© 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
Numbering systems.
Abstraction – Number Systems and Data Representation.
Computers Organization & Assembly Language
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Representing Data. Representing data u The basic unit of memory is the bit  A transistor that can hold either high or low voltage  Conceptually, a tiny.
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
ICS312 Set 1 Representation of Numbers and Characters.
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
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.
EET 250 Number systems. Introduction to Number Systems While we live in a world where the decimal number is predominant in our lives, computers and digital.
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.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
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
Working with 8-bit bytes and hexadecimal
Computer Math CPS120 Introduction to Computer Science Lecture 4.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
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 by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
MECH1500 Chapter 3.
Chapter 1: Binary Systems
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Computer Math CPS120 Introduction to Computer Science Lecture 7.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Software Design and Development Storing Data Computing Science.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
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.
Number Systems & Binary Arithmetic
Number Systems.
Digital Design Chapter One Digital Systems and Binary Numbers
Numbering Systems.
Number Systems and Codes
Lec 3: Data Representation
Number Systems and Binary Arithmetic
CHAPTER 1 : INTRODUCTION
Information Support and Services
EPSII 59:006 Spring 2004.
Number System conversions
How Computers Store Data
Chapter Four Data Representation in Computers By Bezawit E.
CS334: Number Systems Lab 1.
Presentation transcript:

The Hexadecimal Number System and Memory Addressing ISAT 121

2 Familiar Number Systems Roman numerals None, one, few, many Positional value systems Each position in a number has a value Includes concept of zero Example: decimal system

3 Characteristics of Numbering Systems 1) The digits are consecutive. 2) The number of digits is equal to the size of the base. 3) Zero is always the first digit. 4) The base number is never a digit. 5) When 1 is added to the largest digit, a sum of zero and a carry of one results. 6) Numeric values determined by the have implicit positional values of the digits.

4 Significant Digits Binary: Most significant digit Least significant digit Hexadecimal: 1D63A7A Most significant digit Least significant digit

5 History Necessity for understanding numbering systems Historical numbering systems in computing Decimal On/Off Binary (Ada) Bits & bytes ASCII

6 Common terminology TermDefinition Bit A numeral in the binary number system: a 0 or a 1. Byte 8 bits (the smallest addressable memory location). Kilobyte 1024 bytes, which is 2 to the 10th power, often rounded to 1000 bytes. Megabyte Either 1024 kilobytes or 1000 kilobytes, depending on what has come to be standard practice in different situations. For example, when calculating floppy disk capacities, 1 megabyte = 1000 kilobytes; when calculating hard drive capacity, traditionally, 1 megabyte = 1024 kilobytes.

7 Common terminology TermDefinition Gigabyte 1000 megabytes or 1024 megabytes, depending on what has come to be standard practice in different situations. ASCII American Standard Code for Information Interchange coding scheme used for microcomputers, which assigns a 7- or 8-bit code to all characters and symbols. See Appendix B for more information. Hex Short for hexadecimal. A number system based on 16 values (called base 16), which is explained in this appendix. Uses the 16 numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Hex numbers are often followed by a lowercase h to indicate they are in hex (example: 78h).

8 Example / 2 30 = In the lab… 1. Double click on My Computer 2. Right click on C: 3. Click on Properties

9 Decimal Number System Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Base Ten Each position is power of 10 Value = Σ i=0.. n-1 d i * 10 i, n is count of digits in number

10 Decimal Number Example Number: 1946 n = 4 and n – 1 = 3 Positions 1 * 10 3 = * 10 2 = * 10 1 = 40 6 * 10 0 =6 Sum:1946

11 Binary Number System Also called the “Base 2 system” The binary number system is used to model the series of electrical signals computers use to represent information 0 represents the no voltage or an off state 1 represents the presence of voltage or an on state

12 Binary Number System Digits: 0, 1 Base: Two Each position is power of 2 Example: [2] 1* * * * * * * * [10] [10] [10] Sum: 168 [10]

13 Hexadecimal (Hex) Number System Digits: 0..9, A, B, C, D, E, F Base: Sixteen Each position is power of 16 Example: A8 [16] A * 16 1 = 160 [10] 8 * 16 0 =8 [10] Sum:168 [10]

14 Notation for Number Systems Subscript used to denote base 25[10]decimal 19[16]hexadecimal [2]binary Web pages and some programming languages Decimal: no additional symbols Hexadecimal: use pound sign “#” Other notation conventions Hexadecimal: “h” or 0x Octal: “o” Binary: “b”

15 Binary to Hexadecimal Conversion The easiest method for converting binary to hexadecimal is to use a substitution code Each hex digit converts to 4 binary digits

16 Conversion to Hexadecimal Binary to hex: Convert each nibble to hex digit (see previous slide) Decimal to hex: Use repeated division by powers of 16 to find hex digit at each position 16 3 = 4096, 16 2 = 256, 16 1 = 16, 16 0 = [10] to hex: (1946\256 = 7) + (154\16 = 9) + (10\1) = A Sum: 79A (7*256=1792) + (9*16=144) + (10*1=10) = 1946 Or… Windows Calculator

17 Bits, Bytes, and Nibbles Computers use 0 and 1 states to represent data and instructions Each stored state or pathway to transport a state is a bit Eight bits are a byte Basic grouping of bits in computers Can be represented by two hex digits Values: 00..FF or Half of byte is nibble (nybble) Can be represented by one hex digit Values: 0..F or 0..15

18 Binary Integer Addition Binary has only two digits: 0, 1 Addition rules: = = = = 10 Examples: = = = = = = – Overflow

19 Binary Integer Subtraction Two digits: 0, 1 Number of bits dependent Rules for two bits and A≥B 00–00 = 00; 01–00 = 01; 01–01 = 00; 10–00 = 10; 10–01 = 01; 10–10 = 00; 11–00 = 11; 11–01 = 10; 11–10 = 01; 11–11 = 00 A<B governed by signed representation used

20 Two’s Complement Rule for storing signed integers Results in “clock” of numbers Rule for negating a number Take complement of number Value 6 [10] =0110 [2] Complement 1001 Add one1 Yields 2’s complement1010 “Clock” values dependent on number of bits 4 bits: bits: bits: -2,147,483, ,147,483, bits: -9,223,372,036,854,775, ,223,372,036,854,775,

21 Overflow and Underflow Overflow caused by operation generating number greater than register can hold = ≠ -8 Underflow caused by operation generating number less than register can hold 1000 – 0001 = – 1 ≠ 7 Either will cause returned value to wrap around “clock”

22 Example Colors on web pages are often expressed in hex “#00FF80” Graphics editors often represent the color components in decimal values Red: 0 Green: 255 Blue: 128 Graphics editors may represent the color components as percentages Red: 0 Green: 100 Blue: 50 To blend a graphic into the background of a web page, the correct hex value must be calculated

23 Conclusion Questions?