 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation.

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

The Binary Numbering Systems
Representing Information as Bit Patterns Lecture 4 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Data Representation in Computers
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.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Computer Systems 1 Fundamentals of Computing
 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation.
Number Systems & Logic Gates Day 1
© BYU 02 NUMBERS Page 1 ECEn 224 Binary Number Systems and Codes.
Binary Numbers.
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
Numbering Systems CS208.
Chapter 3 Data Representation
Chapter 2 Computer Hardware
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
1 Introduction Chapter 1 n What is Assembly Language? n Data Representation.
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.
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
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.
Binary, Decimal and Hexadecimal Numbers Svetlin Nakov Telerik Corporation
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
Text and Graphics September 26, Unit 3.
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
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 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Data Representation, Number Systems and Base Conversions
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
* Numeral Systems: A writing method for expressing numbers is called a “Numeral System". In the most common numeral system, we write numbers with combinations.
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,
ASCII AND EBCDIC CODES By : madam aisha.
Information Coding Schemes Group Member : Yvonne Tiffany Jurifah bt Junaidi Clara Jane George.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
A+ Computer Repair Lesson 3: Number System. Objectives Define binary, decimal, octal, and hexadecimal numbering systems. Define binary, decimal, octal,
Understanding Computers
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) abcdef or ABCDEF.
CC111 Lec#2 The System Unit The System Unit: Processing and Memory Lecture 2 Binary System.
Understanding Binary Understanding Computers. Understanding Computers L3 – Understanding Binary Learning Objectives All will Understand why all data is.
1.4 Representation of data in computer systems Character.
Some basic concepts underlying computer archi­tecture
Data Representation COE 308 Computer Architecture
Binary Representation in Text
Binary Representation in Text
Understanding binary Understanding Computers.
NUMBER SYSTEMS.
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
3.1 Denary, Binary and Hexadecimal Number Systems
Information Support and Services
Number Systems.
What is Binary? Binary is a two-digit (Base-2) numerical system, which computers use to process and store data. The reason computers use the binary system.
Chapter 3 Data Representation
Introduction to IT By: Muhammed s. anwar.
Ch2: Data Representation
Student: Ying Hong Course: Database Security Instructor: Dr. Yang
Information Representation
Chapter 1 Number System RGGP, Narwana.
Chapter Four Data Representation in Computers By Bezawit E.
Data Representation ICS 233
Lecture 4 Number Systems. von Neumann Model Every computer today is based on the von Neumann Model. It is based on 3 ideas: 1.Four subsystems 2.Stored.
Chapter 3 - Binary Numbering System
Data Representation COE 308 Computer Architecture
Presentation transcript:

 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation  Several number systems are commonly used in computing  Decimal  Binary  Hexadecimal  “Shorthand” for binary Digital Data2

 We count in “decimal” or base 10 by powers of 10:  10 0 = 1  10 1 = 10  10 2 = 10*10 = 100  10 3 = 10*10*10 = 1,000  10 6 = 1,000,000  Computers count in “binary” or base 2:  2 0 = 1  2 1 = 2  2 2 = 2*2 = 4  2 3 = 2*2*2 = 8  2 10 = 1,024 Digital Data3

 Bit (b): binary digit -- 0 or 1 value  0 or 1 correspond to the electrical values of off or on, respectively  All computer data is represented in bits  Byte (B): grouping of 8 bits  Considered the basic unit of digital information  8 bits = 1 byte is the de facto standard (also called an octet )  File sizes and network data are measured in bytes  You can’t have a 5-bit file  Physical network media transmit bits, but network protocols are based on bytes  Unit multiples  Kilobyte: 2 10 = 1,024 bytes (≈ 1,000)  Megabyte: 2 20 = 1,048,576 bytes (≈ 1,000,000)  Gigabyte: 2 30 = 1,073,741,824 bytes (≈ 1,000,000,000)  Terabyte: 2 40 = 1,099,511,627,776 bytes (≈ 1,000,000,000,000) Digital Data4

 Base (also called radix )  Number around which system is organized  Number of symbols used to represent each digit of a number  Digits  Set of symbols used in forming numbers  Additional symbols may be defined for bases > 10  Ex: hexadecimal (see chart at right)  Positional Notation  Position of a digit conveys its significance  Rightmost digit represents the zero- power of the base value  Moving left, each digit represents an increasing power of the base number Number SystemBaseDigits Decimal 100,1,…, 9 Binary 20, 1 Hexadecimal 160, 1,…, 9, A – F Digit Position Number System Decimal , , Binary Hexadecimal , , Digital Data5

 Decimal  Binary  Hexadecimal Digit Position ( k ) 3210 Weight (b k ) Decimal Weight1, Digit (a k ) 2002 Decimal Value 2, = 2,002 Digit Position ( k ) Weight (b k ) Decimal Weight1, Digit (a k ) Decimal Value 1, = 2,002 Digit Position ( k ) 210 Weight (b k ) Decimal Weight Digit (a k ) 7D2 Decimal Value 1, = 2,002 Digital Data6

 Hexadecimal used as shorthand notation for binary  One hex digit represents four binary digits  Hexadecimal numbers are usually prefixed with “0x”  Tells someone reading the number it is a hex value  7D2 16 → 0x7D2 Digital Data7

8 DecimalBinaryHex DecimalBinaryHex A B C D E F

1. Divide the value by the given base x  The remainder will be the least significant (right- most) digit of the base x number 2. Divide the result by the base  The remainder becomes the most significant (left- most) digit of the base x number 3. Repeat step 2 until the result is zero  The remainder is the most significant digit of the base x number Digital Data9

 Convert the decimal value 150 to binary  What decimal value does the bit pattern   Convert the binary pattern  To hex Digital Data10

 Convert 2,016 to binary (base 2)  Convert 2,016 to hexadecimal (base 16) 7 / 16 =0remainder / 16 =7remainder E (14) 2,016 / 16 =126Remainder 0 Digital Data 11 1 / 2 =0remainder 1 3 / 2 =1remainder 1 7 / 2 =3remainder 1 15 / 2 =7remainder 1 31/ 2 =15remainder 1 63 / 2 =31remainder / 2 =63remainder / 2 =126remainder / 2 =252remainder 0 1,008 / 2 =504remainder 0 2,016 / 2 =1,008remainder 0 Binary Digits Left to Right = = 7E0 16 Hex Digits Left to Right

 American Standard Code for Information Interchange (ASCII)  Character-encoding scheme based on the ordering of the English alphabet  Maps digital bit pattern and character symbol  Includes  Printable characters  Alphabet, numbers, symbols  Graphics characters  ■ ┌ ┐ ╔ ╗  Control characters  Backspace, tab, line feed, carriage return  Many of these characters are non-printable Digital Data12

Digital Data13

 Strings are a sequence of bytes  Bytes represent ASCII characters  Characters can be represented as  Character value: ‘m’  Decimal value: 109  Hexadecimal value: 0x6d  Try entering these URLs in a browser    ‘%’ tells the program what follows is a hex value Digital Data14

 A file is a collection of binary data  Format determines the interpretation of bit patterns  Specifies the type of data a file contains  Text, image, sound, Word, Excel, etc.  Example   USA (ASCII text file)  (24-bit bitmap) Digital Data15

 Executable programs are just files  Sequence of bytes  Computers interpret the byte sequence as instructions  Executable file formats  Windows – Portable Executable (PE) format .exe,.dll (libraries),.sys (device drivers)  UNIX – Executable and Linkable Format (ELF)  Also used by UNIX variants  Linux, BSD, Solaris  Mac OS X – Mach object file (Mach-O)  Earlier Mac OSs use Preferred Executable Format (PEF) Digital Data16

 Convention for naming files .  Extension is usually three letters .txt (text),.jpg (JPEG image),.mp3 (MP3 audio),.doc (Word),.xls (Excel)  Can be more or less .c (C source code),.gz (GNU zip),.docx (Word),.xlsx (Excel)  Extension DOES NOT determine bit interpretation  Determined by file format  Operating systems and applications make decisions based on file extension .doc *ought* to be a Word document…I should use Microsoft Word to open it  Extensions can be changed without changing the file format  Example: change.zip to.txt to a ZIP file  Can still open the “.txt” file with a program that recognizes the ZIP file format Digital Data17

 What string is represented by the ASCII values :  What exactly is displayed when we open the file yay.txt in notepad which consists of the following bytes:  What exactly would be displayed in Frhed when we open yay.txt? Digital Data18

 Number Systems Decoded detail.asp?wpid=315  RFC 20: ASCII format for Network Interchange  File Signatures Table  Comparison of Executable File Formats able_file_formats Digital Data19