Data Representation. Data Representation, Storage, and Retrieval. Data Representation. Data Representation. Data Representation. Data Representation

Similar documents
Chapter 4: Computer Codes

Counting in base 10, 2 and 16

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Base Conversion written by Cathy Saxton

Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to:

Number Representation

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Lecture 11: Number Systems

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

2011, The McGraw-Hill Companies, Inc. Chapter 3

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Data Storage 3.1. Foundations of Computer Science Cengage Learning

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

Binary Representation

Memory is implemented as an array of electronic switches

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

The use of binary codes to represent characters

Section 1.4 Place Value Systems of Numeration in Other Bases

CSI 333 Lecture 1 Number Systems

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Useful Number Systems

Systems I: Computer Organization and Architecture

Unsigned Conversions from Decimal or to Decimal and other Number Systems

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

Cloud storage Megas, Gigas and Teras

MEMORY STORAGE CALCULATIONS. Professor Jonathan Eckstein (adapted from a document due to M. Sklar and C. Iyigun)

Numbering Systems. InThisAppendix...

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

The Hexadecimal Number System and Memory Addressing

Computer Logic (2.2.3)

Binary, Hexadecimal, Octal, and BCD Numbers

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Chapter 2: Basics on computers and digital information coding. A.A Information Technology and Arts Organizations

=

The string of digits in the binary number system represents the quantity

Encoding Text with a Small Alphabet

lesson 1 An Overview of the Computer System

Computer Science 281 Binary and Hexadecimal Review

Cyber Security Workshop Encryption Reference Manual

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Chapter 2. Binary Values and Number Systems

HOMEWORK # 2 SOLUTIO

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

ASCII Code. Numerous codes were invented, including Émile Baudot's code (known as Baudot

Solution for Homework 2

Data Storage: Each time you create a variable in memory, a certain amount of memory is allocated for that variable based on its data type (or class).

Number Systems. Introduction / Number Systems

CPEN Digital Logic Design Binary Systems

Digital Logic Design. Introduction

Introduction to Computer & Information Systems

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

Chapter 3: Computer Hardware Components: CPU, Memory, and I/O

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

STUDY GUIDE CHAPTER 1

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

HOW TO BECOME AN ESI HERO

Zeros, Ones, and the Morse Code

Computer Basics: Chapters 1 & 2

The Answer to the 14 Most Frequently Asked Modbus Questions

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Discovering Computers Living in a Digital World

3. Convert a number from one number system to another

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Data Storage. 1s and 0s

Chapter 4 System Unit Components. Discovering Computers Your Interactive Guide to the Digital World

Binary Numbers. Binary Octal Hexadecimal

CHAPTER 5. Obfuscation is a process of converting original data into unintelligible data. It

ELECTRONIC DOCUMENT IMAGING

The programming language C. sws1 1

Chapter 5. Binary, octal and hexadecimal numbers

The Central Processing Unit:

CSCA0102 IT & Business Applications. Foundation in Business Information Technology School of Engineering & Computing Sciences FTMS College Global

The science of computing

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

Chapter 1: Digital Systems and Binary Numbers

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

CS201: Architecture and Assembly Language

Definition of Computers. INTRODUCTION to COMPUTERS. Historical Development ENIAC

Decimal to Binary Conversion

I PUC - Computer Science. Practical s Syllabus. Contents

NUMBER SYSTEMS APPENDIX D. You will learn about the following in this appendix:

COMPSCI 210. Binary Fractions. Agenda & Reading

THE BINARY NUMBER SYSTEM

Data Representation. What is a number? Decimal Representation. Interpreting bits to give them meaning. Part 1: Numbers. six seis

winhex Disk Editor, RAM Editor PRESENTED BY: OMAR ZYADAT and LOAI HATTAR

Representação de Caracteres

Computer Science PLUS I Volume 1 : Concepts Government of Tamilnadu

Count the Dots Binary Numbers

Transcription:

, Storage, and Retrieval ULM/HHIM Summer Program Project 3, Day 3, Part 3 Digital computers convert the data they process into a digital value. Text Audio Images/Graphics Video Digitizing 00000000... 6/8/20 Paul D. Wiedemeier, Ph.D. 6/8/20 Paul D. Wiedemeier, Ph.D. 2 The digits used by a digital computer to represent data are 0 and. Because we only use two digits to represent all data, this type of representation is called Binary Why don t we just use digits 0-9 (i.e. decimal representation) to represent all data instead of 0 and? Because the two states of an electrical circuits are Low and High voltage. Low voltage on a wire = Off = 0 bit High voltage on a wire = On = bit 6/8/20 Paul D. Wiedemeier, Ph.D. 3 6/8/20 Paul D. Wiedemeier, Ph.D. 4 A bit is a state which is either 0 or (i.e. either Off or On ). The term bit is short for binary digit A bit is the smallest unit of data that a computer can process. A bit is also the smallest unit by which memory and storage media is measured. Since a single bit is either 0 or, it can only represent, at most, two unique pieces of data. Mathematically: 2 = 2 data representations However, a grouping of 8 bits can represent 256 unique pieces of data. Mathematically: 2 8 = 2*2*2*2*2*2*2*2 = 256 data representations 6/8/20 Paul D. Wiedemeier, Ph.D. 5 6/8/20 Paul D. Wiedemeier, Ph.D. 6

A group of 8 bits is called a Byte (B). That is, a byte of memory. A nibble of memory is 4 bits. Kilobyte (KB),024 (2 0 ) Bytes Commonly,000 Bytes 8,92 bits = 8 bits/byte *,024 Bytes A word of memory is 2 bytes or 4 bytes or 2 N bytes depending on the computer architecture used. 6/8/20 Paul D. Wiedemeier, Ph.D. 7 6/8/20 Paul D. Wiedemeier, Ph.D. 8 Megabyte (MB),024 (2 0 ) Kilobytes,048,576 (2 20 ) Bytes Commonly,000,000 Bytes 8,388,608 bits Gigabyte (GB),024 (2 0 ) Megabytes,048,576 (2 20 ) Kilobytes,073,74,824 (2 30 ) Bytes Commonly,000,000,000 Bytes 8,589,934,592 bits 6/8/20 Paul D. Wiedemeier, Ph.D. 9 6/8/20 Paul D. Wiedemeier, Ph.D. 0 Terabyte (TB),024 (2 0 ) Gigabytes,048,576 (2 20 ) Megabytes,073,74,824 (2 30 ) Kilobytes,099,5,627,776 (2 40 ) Bytes Commonly,000,000,000,000 Bytes 8.796093022 * 0 2 bits Data Types 6/8/20 Paul D. Wiedemeier, Ph.D. 6/8/20 Paul D. Wiedemeier, Ph.D. 2 2

Data Types What types of data exist? Text, which includes Characters & Numbers Audio, Images/Graphics, and Video Each requires a unique binary file format in order to be processed by a computer. Data Type Text - Characters Text - Numbers Audio Images/Graphics Video Data Types File Format ASCII, EBCDIC, Unicode Unsigned Binary Integer Two s Complement Integer Binary Coded Decimal IEEE 754 Floating Point WAV, AU, MP3, etc. JPEG, GIV, TIFF, PNG, BMP, PDF, PostScript, TrueType, etc. QuickTime, MPEG-4, etc. 6/8/20 Paul D. Wiedemeier, Ph.D. 3 6/8/20 Paul D. Wiedemeier, Ph.D. 4 Since a byte can represent 256 (i.e. 2 8 ) unique pieces of data, the computer has the ability to represent textual character data. Digits 0-9 Uppercase and lowercase alphabet Foreign characters (i.e. umlauts and tilde) Special characters (i.e. punctuation marks) 6/8/20 Paul D. Wiedemeier, Ph.D. 5 6/8/20 Paul D. Wiedemeier, Ph.D. 6 The process of using a byte to represent character data is called encoding. Widely used encoding schemes include ASCII EBCDIC Unicode ASCII American Standard Code for Information Interchange 7 bit encoding scheme (e.g. 2 7 = 28 encodings) Of the three, ASCII is most popular because it is used primarily by personal computers. 6/8/20 Paul D. Wiedemeier, Ph.D. 7 6/8/20 Paul D. Wiedemeier, Ph.D. 8 3

EBCDIC How the character A is represented in ASCII Extended Binary Coded Decimal Interchange Code 8 bit encoding scheme (e.g. 2 8 = 256 encodings) 0 0 0 0 0 0 ASCII A = 000000 The encoding scheme used primarily by IBM mainframe computers. 6/8/20 Paul D. Wiedemeier, Ph.D. 9 6/8/20 Paul D. Wiedemeier, Ph.D. 20 Data Encoding A Output Device 000000 The word DATA in ASCII A Main Memory 000000.000000.00000.000000 Input Device 000000 6/8/20 Paul D. Wiedemeier, Ph.D. 2 6/8/20 Paul D. Wiedemeier, Ph.D. 22 ASCII is a 7 bit encoding scheme. 28 possible data representation It can easily represent all characters, digits, etc. in the English language. EBCDIC is an 8 bit encoding scheme. 256 possible data representation. What about Foreign Languages? 8 bit encoding schemes won t work! Why? Unicode Three unique encodings: 8 bit - mathematically: 2 8 = 256 encodings 6 bit - mathematically: 2 6 = 65,536 encodings 32 bit - mathematically: 2 32 = 4,294,967,296 encodings Unicode can represent all the characters from all Earth languages. 6/8/20 Paul D. Wiedemeier, Ph.D. 23 6/8/20 Paul D. Wiedemeier, Ph.D. 24 4

Numeric Numeric ASCII, EBCDIC, and Unicode are encoding schemes used to represent character data. Problem + is not equivalent to 2 6/8/20 Paul D. Wiedemeier, Ph.D. 25 6/8/20 Paul D. Wiedemeier, Ph.D. 26 Numeric Unique representations exist for numeric data. Integer Representations Unsigned Binary ***Two s Compliment Binary*** Binary Coded Decimal Number Systems Floating Point Representation ***IEEE 754 Floating Point Standard*** 6/8/20 Paul D. Wiedemeier, Ph.D. 27 6/8/20 Paul D. Wiedemeier, Ph.D. 28 Number Systems The base of a number system indicated how many symbols are used. Each symbol in a specific number system has a value associated with it. Each position in a specific number system has a value associated with it. Number Systems Four commonly used computer system number systems include Decimal Binary Hexadecimal Octal Polynomial Representation 6/8/20 Paul D. Wiedemeier, Ph.D. 29 6/8/20 Paul D. Wiedemeier, Ph.D. 30 5

Decimal Number System Decimal Number System Base 0 Symbols (0,,2,3,4,5,6,7,8,9) 6/8/20 Paul D. Wiedemeier, Ph.D. 3 6/8/20 Paul D. Wiedemeier, Ph.D. 32 Decimal Number System Polynomial Representation 0th - 0 0 = (ones) st - 0 = 0 (tens) 2nd - 0 2 = 00 (hundreds) 3rd - 0 3 = 000 (thousands) and so on Decimal Number System 95 decimal 9*(0 ) + 5*(0 0 ) decimal 90 + 5 decimal 95 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 33 6/8/20 Paul D. Wiedemeier, Ph.D. 34 Decimal Number System 243 decimal 2*(0 2 ) + 4*(0 ) + 3*(0 0 ) decimal 200 + 40 + 3 decimal 243 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 35 6/8/20 Paul D. Wiedemeier, Ph.D. 36 6

Base 2 Symbols (0,) Polynomial Representation 0th 2 0 = st 2 = 2 2nd 2 2 = 4 3rd 2 3 = 8 and so on 6/8/20 Paul D. Wiedemeier, Ph.D. 37 6/8/20 Paul D. Wiedemeier, Ph.D. 38 0 binary 0*(2 0 ) decimal 0 decimal binary *(2 0 ) decimal decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 39 6/8/20 Paul D. Wiedemeier, Ph.D. 40 0 binary *(2 ) + 0*(2 0 ) decimal 2 + 0 decimal 2 decimal binary *(2 ) + *(2 0 ) decimal 2 + decimal 3 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 4 6/8/20 Paul D. Wiedemeier, Ph.D. 42 7

00 binary 0*(2 7 ) + *(2 6 ) + 0*(2 5 ) + *(2 4 ) + *(2 3 ) + *(2 2 ) + *(2 ) + *(2 0 ) decimal 0 + 64 + 0 + 6 + 8 + 4 + 2 + decimal 95 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 43 00 binary *(2 7 ) + *(2 6 ) + *(2 5 ) + *(2 4 ) + 0*(2 3 ) + 0*(2 2 ) + *(2 ) + *(2 0 ) decimal 28 + 64 + 32 + 6 + 0 + 0 + 2 + decimal 243 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 44 Decimal to Binary Conversion Decimal to Binary Conversion To convert a decimal number into its binary equivalent. Divide the decimal number by 2 2. The remainder will be a symbol in the binary number at a given position. 3. If the whole part of the division is not zero, then goto step. Otherwise stop. 6/8/20 Paul D. Wiedemeier, Ph.D. 45 6/8/20 Paul D. Wiedemeier, Ph.D. 46 Decimal to Binary Conversion 2 2 2 2 5 2 2 23 2 47 2 95 Remainder 0 6/8/20 Paul D. Wiedemeier, Ph.D. 47 Least Significant Bit (Right-Most Bit) Decimal to Binary Conversion 2 2 3 2 7 2 5 2 30 2 60 2 2 2 243 Remainder 6/8/20 Paul D. Wiedemeier, Ph.D. 48 0 0 Least Significant Bit (Right-Most Bit) 8

Hexadecimal Number System Hexadecimal Number System Base 6 Symbols (0,,2,3,4,5,6,7,8,9,A,B,C,D,E,F) 6/8/20 Paul D. Wiedemeier, Ph.D. 49 6/8/20 Paul D. Wiedemeier, Ph.D. 50 Hexadecimal Number System Hexadecimal Number System Polynomial Representation 0th 6 0 = st 6 = 6 2nd 6 2 = 256 3rd 6 3 = 4096 and so on Binary Decimal Hex 0000 0 0 000 000 2 2 00 3 3 000 4 4 00 5 5 00 6 6 0 7 7 Binary Decimal Hex 000 8 8 00 9 9 00 0 A 0 B 00 2 C 0 3 D 0 4 E 5 F 6/8/20 Paul D. Wiedemeier, Ph.D. 5 6/8/20 Paul D. Wiedemeier, Ph.D. 52 Hexadecimal Number System 5F hex 5*(6 ) + 5*(6 0 ) decimal 80 + 5 decimal 95 decimal Hexadecimal Number System F3 hex 5*(6 ) + 3*(6 0 ) decimal 240 + 3 decimal 243 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 53 6/8/20 Paul D. Wiedemeier, Ph.D. 54 9

Hexadecimal Number System 49 hex 4*(6 ) + 9*(6 0 ) decimal 64 + 9 decimal 73 decimal Hexadecimal Number System FA hex 5*(6 ) + 0*(6 0 ) decimal 240 + 0 decimal 250 decimal 6/8/20 Paul D. Wiedemeier, Ph.D. 55 6/8/20 Paul D. Wiedemeier, Ph.D. 56 Decimal to Binary Conversion Decimal to Hex Conversion To convert a decimal number into its hexadecimal equivalent. Divide the decimal number by 6 2. The remainder will be a symbol in the hex number at a given position. 3. If the whole part of the division is not zero, then goto step. Otherwise stop. 6/8/20 Paul D. Wiedemeier, Ph.D. 57 6/8/20 Paul D. Wiedemeier, Ph.D. 58 Decimal to Hex Conversion Decimal to Hex Conversion 6 5 6 95 Remainder 5 5 Remainder 5 F Least Significant (Right-Most) 6 5 6 243 Remainder 5 3 Remainder F 3 Least Significant (Right-Most) 6/8/20 Paul D. Wiedemeier, Ph.D. 59 6/8/20 Paul D. Wiedemeier, Ph.D. 60 0

Binary to Hex Conversion Binary to Hex Conversion To convert a binary number into its hexadecimal equivalent. Starting with the least significant binary digit, group bits into groups of four (4) from right to left. 2. For each group of four (4) bits, convert them into their hexadecimal equivalent (see earlier table). 6/8/20 Paul D. Wiedemeier, Ph.D. 6 6/8/20 Paul D. Wiedemeier, Ph.D. 62 Binary to Hex Conversion 0 Binary to Hex Conversion 00 00 00 5F F3 6/8/20 Paul D. Wiedemeier, Ph.D. 63 6/8/20 Paul D. Wiedemeier, Ph.D. 64 Hex to Binary Conversion Hex to Binary Conversion To convert a binary number into its hexadecimal equivalent. Convert each hexadecimal symbol into its four (4) bit binary equivalent (see earlier table). 6/8/20 Paul D. Wiedemeier, Ph.D. 65 6/8/20 Paul D. Wiedemeier, Ph.D. 66

Hex to Binary Conversion 5F Hex to Binary Conversion F3 00 00 00 00 6/8/20 Paul D. Wiedemeier, Ph.D. 67 6/8/20 Paul D. Wiedemeier, Ph.D. 68 Octal Number System Octal Number System Base 8 Symbols (0,,2,3,4,5,6,7) 6/8/20 Paul D. Wiedemeier, Ph.D. 69 6/8/20 Paul D. Wiedemeier, Ph.D. 70 Octal Number System Polynomial Representation 0th 8 0 = st 8 = 8 2nd 8 2 = 64 3rd 8 3 = 52 and so on Octal Number System Binary Decimal Octal 000 0 0 00 00 2 2 0 3 3 00 4 4 0 5 5 0 6 6 7 7 6/8/20 Paul D. Wiedemeier, Ph.D. 7 6/8/20 Paul D. Wiedemeier, Ph.D. 72 2

Octal Number System How would you convert the following? Decimal to Octal Octal to Decimal Converting Between Bases Octal to Binary Binary to Octal Octal to Hexadecimal Hexadecimal to Octal 6/8/20 Paul D. Wiedemeier, Ph.D. 73 6/8/20 Paul D. Wiedemeier, Ph.D. 74 Converting Between Bases Assume N is the number you wish to convert. If N is a decimal number, then. Divide the decimal number by the base you wish to obtain. 2. The remainder will be a symbol in the number at a given position. 3. If the whole part of the division is not zero, then goto step. Otherwise stop. 6/8/20 Paul D. Wiedemeier, Ph.D. 75 Converting Between Bases If N is a hexadecimal or octal number and you wish to obtain a binary number, then. Use the tables shown earlier, or better yet memorize the conversion values. If N is a hexadecimal or octal number and you wish to obtain a decimal number, then. Use polynomial representation. 6/8/20 Paul D. Wiedemeier, Ph.D. 76 Converting Between Bases If N is a hexadecimal or octal number and you wish to obtain an octal or hexadecimal number, then.convert the number to binary. Then, use the tables shown earlier to convert. Converting Between Bases If N is a binary number and you wish to obtain a hexadecimal or octal number, then.use the tables shown earlier, or better yet memorize the conversion values. 2.Of, convert the number to decimal. Then, use polynomial representation. 6/8/20 Paul D. Wiedemeier, Ph.D. 77 6/8/20 Paul D. Wiedemeier, Ph.D. 78 3

Converting Between Bases If N is a binary number and you wish to obtain a decimal number, then Converting Between Bases Hexadecimal. Use polynomial representation. Binary Decimal 2. Or Convert the binary number into a hexadecimal number (using tables or memory). Then, convert the hexadecimal number into a decimal number using polynomial representation. 6/8/20 Paul D. Wiedemeier, Ph.D. 79 Tables Polynomial Rep. Octal Base Division 6/8/20 Paul D. Wiedemeier, Ph.D. 80 4