Lab #1 Follow-Up Unix Binary / Hexadecimal Python.

Slides:



Advertisements
Similar presentations
How to Convert Decimal Numbers to Binary EXAMPLES.
Advertisements

DATA REPRESENTATION CONVERSION.
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
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
Data Representation in Computers
Number System Conversions Lecture L2.2 Section 2.3.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
CISCO NETWORKING ACADEMY Chabot College ELEC 74A Hexadecimal Introduction.
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Decimal to Binary Conversion Press any key to continue…
Converting binary to decimal decimal to binary
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
Number Systems.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Binary Numbers. Why Binary? Maximal distinction among values  minimal corruption from noise Imagine taking the same physical attribute of a circuit,
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
1 Pertemuan 2 Network Math. Discussion Topics Binary presentation of data Bits and bytes Base 10 number system Base 2 number system Converting decimal.
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
Conversion of Number System Conversion Among Bases The possibilities: Hexadecimal DecimalOctal Binary
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there.
Number Systems 2.1 Information Storage Why not decimal numbers in computers ? Difficult to store ENIAC (1 st electronic computer) used 10 vacuum tubes.
Number systems, Operations, and Codes
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Positional Notation 642 in base 10 positional notation is:
Number Base Conversions
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
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.
Ms. Nixon-Williams Grade 6 Honors Fractions, Decimals, Percent, Ratios Grade 6 Honors Fractions, Decimals, Percent, Ratios.
Octal to Decimal Hexadecimal DecimalOctal Binary.
DECIMALBINARY a) b) c) d) e) f) Revision Exercise DECIMALBINARY a) b) c)
Codes Octal Power Hexadecimal ASCII BCD Code
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Phys 4330 Digital ElectronicsBinary System Digital circuits process signals that contain just two voltage levels or states, labeled logic "0" and logic.
Renaming Fractions as Decimals The trick to this is to get the fraction in a base divisible by The denominator is in base 10. The zeros in the.
OFF = 0 ON = 1 = 63 BINARY system
Conversions % Multiply by a special form of 1 Divide 2 by 5
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.
Computer Hardware & Operation Northern College Diploma Philip Bird.
Number Systems. There are 10 kinds of people in the world, those who understand binary and those who don’t.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Binary 1 Basic conversions.
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
Data Representation Binary Numbers Binary Addition
Integer Real Numbers Character Boolean Memory Address CPU Data Types
BINARY CODE.
Introduction to Chapter 2
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
CSE 102 Introduction to Computer Engineering
Computer Fundamentals
Number System conversions
Number Systems.
Chapter 2: Number Systems
How Computers Store Data
Chapter Four Data Representation in Computers By Bezawit E.
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Beyond Base 10: Non-decimal Based Number Systems
Converting between Percentages, Decimals and Fractions
Lecture 37 – Practice Exercises 9
Chapter 2 Number Systems.
Lecture 37 – Practice Exercises 9
Presentation transcript:

Lab #1 Follow-Up Unix Binary / Hexadecimal Python

Lab #1 Follow-Up Unix Binary / Hexadecimal Python

Media Access Control (MAC) address

B4-D8-A

DecimalHex(adecimal) A 11B 12C 13D 14E 15F

B 4 DecimalHex(adecimal) A 11B 12C 13D 14E 15F

B 4 DecimalHex(adecimal) A 11B 12C 13D 14E 15F 11×16 + 4×1

B 4 DecimalHex(adecimal) A 11B 12C 13D 14E 15F 11× ×16 0

B 4 DecimalHex(adecimal) A 11B 12C 13D 14E 15F 11×16 + 4×1

B 4 DecimalHex(adecimal) A 11B 12C 13D 14E 15F 11×16 + 4×

B 4 DecimalHex(adecimal) A 11B 12C 13D 14E 15F 11×16 + 4×

All modern numbering systems work this way B 4 11× × ×16 + 4× × × × × ×10 + 0×1 180

Why Base 16?

DecimalHexBinary A B C D E F1111

Why Base 16? DecimalHexBinary A B C D E F1111

B 4 Eight Bits = One Byte DecimalHexBinary A B C D E F

Why Base Two?

ENIAC (1946)

1940s Faster, Cheaper, Smaller 1950s 1960s Today Vacuum tube RelayTransistor Integrated Circuits

● To convert from binary to decimal Start from right Multiply 0,1 by powers of two (1, 2, 4, 8, …) Sum of these products is decimal equivalent ● E.g., = ??? 10 Binary-to-Decimal Conversion

● To convert from binary to decimal Start from right Multiply 0,1 by powers of two (1, 2, 4, 8, …) Sum of these products is decimal equivalent ● E.g., = ??? 10 1 * 2 0 = 1 Binary-to-Decimal Conversion

● To convert from binary to decimal Start from right Multiply 0,1 by powers of two (1, 2, 4, 8, …) Sum of these products is decimal equivalent ● E.g., = ??? 10 1 * 2 0 = 1 +0 * 2 1 = 0

Binary-to-Decimal Conversion ● To convert from binary to decimal Start from right Multiply 0,1 by powers of two (1, 2, 4, 8, …) Sum of these products is decimal equivalent ● E.g., = ??? 10 1 * 2 0 = 1 +0 * 2 1 = 0 +1 * 2 2 = 4

Binary-to-Decimal Conversion ● To convert from binary to decimal Start from right Multiply 0,1 by powers of two (1, 2, 4, 8, …) Sum of these products is decimal equivalent ● E.g., = ??? 10 1 * 2 0 = 1 +0 * 2 1 = 0 +1 * 2 2 = 4 +1 * 2 3 = 8

Binary-to-Decimal Conversion ● To convert from binary to decimal Start from right Multiply 0,1 by powers of two (1, 2, 4, 8, …) Sum of these products is decimal equivalent ● E.g., = * 2 0 = 1 +0 * 2 1 = 0 +1 * 2 2 = 4 +1 * 2 3 = 8 ____________ 13

13r 2 = 1 13 ÷ 2 = 6 6r 2 = 0 6 ÷ 2 = 3 3r 2 = 1 3 ÷ 2 = 1 1r 2 = 1 1 ÷ 2 = 0 ___________ Decimal-to-Binary Conversion To convert from decimal to binary 1.Take remainder of decimal number / 2 2.Write down remainder right-to-left 3.If decimal number is zero, we’re done 4.Divide decimal number by 2 5.Go to step 1.

Fractions = ???? 2

Fractions × × ×10 -2

Fractions = 3× × × × × × ×2 -2

Problem! = ???? 2

Google patriot missile failure for a real-world example

What about text? ASCII: One byte per character

What about text? Unicode: (Up to) two bytes per character

Numbers or text? Each application (MS Word, Excel) expects either (ASCII) text or (“raw binary”) numbers Try opening a an Excel spreadsheet in WordPad!