Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

Lecture - 2 Number systems and computer data formats
Chapter 1 Digital Systems and Numbers System
CIS 020 Assembly Programming Chapter 02 - Numbering Systems & Data Representation © John Urrutia 2012, All Rights Reserved.5/27/20121.
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
How Computers Represent Numbers Friday, Week 5. Binary Code A series of 1’s and 0’s Place value is in powers of 2.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
How Computers Represent Numbers Friday, Week 5. Binary Code A series of 1’s and 0’s Place value is in powers of 2.
Binary Representation
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Data Representation in Computers
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Number Systems and Arithmetic
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Binary Numbers.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
© GCSE Computing Candidates should be able to:  convert positive denary whole numbers (0-255) into 8-bit binary numbers and vice versa  add two 8-bit.
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
Binary and Hexadecimal Numbers
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
Numbering systems.
Binary Numbers.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
Chapter 3 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,
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.
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
Number systems, Operations, and Codes
Chapter1: Number Systems
Section 3.1: Number Representation Practice HW (not to hand in) From Barr Text p. 185 # 1-5.
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.
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.
Section 4.3 Other Bases.
Octal to Decimal Hexadecimal DecimalOctal Binary.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Introduction To Number Systems Binary System M. AL-Towaileb1.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Number Representation Lecture Topics How are numeric data items actually stored in computer memory? How much space (memory locations) is.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
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.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Some basic concepts underlying computer archi­tecture
Introduction To Number Systems
Digital Design Chapter One Digital Systems and Binary Numbers
Binary 1 Basic conversions.
Different Numeral Systems
Octal to Decimal Decimal Octal Binary Hexadecimal.
3.1 Denary, Binary and Hexadecimal Number Systems
ECE 103 Engineering Programming Chapter 3 Numbers
Chapter 3 Data Representation
Number System conversions
Data Encoding Characters.
University of Gujrat Department of Computer Science
Number Systems and Binary Arithmetic
Introduction to IT By: Muhammed s. anwar.
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Numbering System TODAY AND TOMORROW 11th Edition
How Computers Store Data
Chapter Four Data Representation in Computers By Bezawit E.
Beyond Base 10: Non-decimal Based Number Systems
Binary, Hexadecimal, and Base 10.
UNIT – 3 & 4. Data Representation and Internal
Chapter 3 - Binary Numbering System
Section 4.3 Other Bases.
Presentation transcript:

Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation of Numbers – Ordinary numbers that we see each day are represented as base 10. The numbers are a sum of powers of 10. Example 1: Write as sum of powers of 10… Example 1

Representation of Numbers Binary Numbers – Binary Numbers are base 2 numbers. They are represented by just two digits: 0, and 1. Examples of binary numbers Examples – Definition of a binary numberbinary number – Example 2: Find decimal equivalent of the binary number 100. Example 2 – Example 3: Find decimal equivalent of the binary number Example 3 – Example 4: Find the decimal equivalent of the binary number … Example 4

Representation of Numbers To convert a decimal (base 10) number to binary, we divide the number by 2, getting a quotient and remainder. This process repeats itself until the quotient is zero. Reading the resulting remainders from last to the first gives the binary representation of the number. – Example 5: Convert 77 to binary Example 5 – Example 6: Convert 320 to binary Example 6 – Example 7: Convert 687 to binary… Example 7

Approximating the Size of Binary Numbers Many times the strength of a cryptographic method is expressed in terms of the size of a particular parameter. – Many times this parameter is expressed by the number of binary digits the number has. – Base 10 Number Size Binary Bound EstimateBinary Bound Estimate – Example 8: 32 bit number bound estimate Example 8 – Definition: Given a real number x, we say that ceil(x) is the smallest integer greater than x. Example: ceil(29.6) = 30. – Estimate of the number of binary digits required to express a base 10 decimal number. Estimate of the number – Example 9: Approximate how many binary digits are used to represent the number … Example 9

Conversion to Numbers Involving Other Bases Definition: A number of any given base. Definition Example 10: Convert the numeral 5476 from base 8 to base 10. Example 10 For bases that are larger than 10 we need additional digits. We use letters for these digits: A, B, C, D, etc. Digits For Base 12 & 16 Digits Example 11: Convert EA3 base 16 to base 10… Example 11

Converting From Base 10 Numbers to an Arbitrary Base To convert a decimal (base 10) number to an arbitrary base a, we divide the number by a, getting a quotient and remainder. The quotient is then divided by a, obtaining a new quotient and remainder. This process repeats itself until the quotient is zero. Reading the resulting remainders from the last to the first gives the base a representation of the number. Example 12: Convert 689 to base 5. Example 12 Example 13: Convert to Hexadecimal… Example 13

Converting From Binary to Hexadecimal The Binary to Hexadecimal Table.Binary to Hexadecimal – Write the binary number in blocks of 4 digits. If there are not enough fill in on the left with 0’s. – Using the table, convert each four digit binary block to its hexadecimal equivalent. – Example 14: Convert to hexadecimal. Example 14 – Example 15: Convert to hexadecimal. Example 15 – Example 16: Convert A61F0 to binary. Example 16 – Example 17: Convert 72E1C5 to binary… Example 17

Binary XOR Operation The binary XOR operation has the following properties:XOR – If two things are true (value of 1) then the result of the xor operation is false (value of 0). – If two things are false (value of 0) then the result of the xor operation is false – If exactly one of the two is true, and therefore the other is false, then the result of the xor operation is true. – Example 18: Compute xor of two numbers Example 18 – Example 19: Compute xor of two numbers … Example 19

ASCII Codes for Characters So far we have used MOD 26 alphabet assignment table to assign numerical values to each letter. Computers normally use the ASCII (American Standard Code for Information Interchange) for obtaining numerical representation of characters. Example 20: Find numerical ASCII representation. Example 20 Example 21: Decode ASCII number message…! Example 21