CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
CMSC 104, Version 9/01 1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. 1 Number Systems 0, 1 0, 1, 2, 3, 4, 5, 6, 7 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 0, 1, 2, 3,
© Maths Support Service 2007 Binary and Hexadecimal Numbers Next Slide AE98FD AE98FD.
© 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.
Binary and Hexadecimal Numbers
Number Systems.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
Binary Numbers.
The number systems of Computer Science
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
CMSC104 Lecture 2 Remember to report to the lab on Wednesday.
Number Systems Ron Christensen CIS 121.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Number systems, Operations, and Codes
Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system.
Converting From decimal to Binary & Hexadecimal to Binary
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Number Systems 0, 1 0, 1, 2,
AP Computer Science A – Healdsburg High School 1 Unit 1 - Binary Numbers - Hexadecimal Numbers.
How a Computer Processes Information. Java – Numbering Systems OBJECTIVE - Introduction to Numbering Systems and their relation to Computer Problems Review.
CSC 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
DECIMALBINARY a) b) c) d) e) f) Revision Exercise DECIMALBINARY a) b) c)
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Machine Architecture and Number Systems
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
CMSC Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number.
Number Representation Lecture Topics How are numeric data items actually stored in computer memory? How much space (memory locations) is.
Binary Decimal Hexadecimal
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
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.
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr.
Chapter 01 Numbers. Chapter 02 Base 10 example Decimal Number Place Place (place - 1) ===============================
Computer Maintenance Numbering Systems Copyright © Texas Education Agency, All rights reserved.1.
UMBC CMSC 104 – Section 01, Fall UMBC CMSC 104, Section 01 - Fall 2016  Nothing. Enjoy your weekend! 2.
Some basic concepts underlying computer archi­tecture
Appendix F Number Systems binary 0, 1 0, 1, 2, 3, 4, 5, 6, 7
Computer Architecture and Number Systems
Computer Maintenance Numbering Systems Trade & Industrial Education
Binary, Denary, Hexadecimal Conversion Binary Addition
Different Numeral Systems
Unit 18: Computational Thinking
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Convert Decimal to Binary
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
University of Gujrat Department of Computer Science
Machine Architecture and Number Systems
Number Systems and Binary Arithmetic
Numbering System TODAY AND TOMORROW 11th Edition
Binary / Hex Binary and Hex The number systems of Computer Science.
Machine Architecture and Number Systems
Digital Electronics and Microprocessors
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Chapter Four Data Representation in Computers By Bezawit E.
Notes from Last Class Office Hours: GL Accounts?
Machine Architecture and Number Systems
Presentation transcript:

CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science

CMSC 104, Lecture 052 Number Systems in Main Memory l The on and off states of the capacitors in RAM can be thought of as the values 1 and 0, respectively. l Therefore, thinking about how information is stored in RAM requires knowledge of the binary (base 2) number system. l Let’s review the decimal (base 10) number system first.

CMSC 104, Lecture 053 The Decimal Numbering System l The decimal numbering system is a positional number system. l Example: X 10 0 = X 10 1 = 20 6 X 10 2 = X 10 3 = 5000

CMSC 104, Lecture 054 What is the base ? l The decimal numbering system is also known as base 10. The values of the positions are calculated by taking 10 to some power. l Why is the base 10 for decimal numbers ? Because we use 10 digits: the digits 0 through 9.

CMSC 104, Lecture 055 The Binary Number System l The binary numbering system is also known as base 2. The values of the positions are calculated by taking 2 to some power. l Why is the base 2 for binary numbers ? Because we use 2 digits: the digits 0 and 1.

CMSC 104, Lecture 056 The Binary Number System (con’t) l The Binary Number System is also a positional numbering system. l Instead of using ten digits, 0 - 9, the binary system uses only two digits, 0 and 1. l Example of a binary number and the values of the positions:

CMSC 104, Lecture 057 Converting from Binary to Decimal X 2 0 = X 2 1 = 0 1 X 2 2 = = = 16 1 X 2 3 = = = 32 0 X 2 4 = = = 64 0 X 2 5 = = 81 X 2 6 = 64 77

CMSC 104, Lecture 058 Converting from Binary to Decimal (con’t) Practice conversions: Binary Decimal

CMSC 104, Lecture 059 Converting Decimal to Binary First make a list of the values of 2 to the powers of 0 to the number being converted - e.g: 2 0 = 1, 2 2 = 4, 2 3 = 8, 2 4 = 16, 2 5 = 32, 2 6 = 64,… Perform successive divisions by 2, placing the remainder of 0 or 1 in each of the positions from right to left. Continue until the quotient is zero; e.g.: alternative method: “subtract maximum powers and repeat”. E.g.: = = =

CMSC 104, Lecture 0510 Converting From Decimal to Binary (con’t) Practice conversions: Decimal Binary

CMSC 104, Lecture 0511 Counting in Binary l Binary l Decimal equivalent

CMSC 104, Lecture 0512 Addition of Binary Numbers l Examples:

CMSC 104, Lecture 0513 Addition of Large Binary Numbers l Example showing larger numbers:

CMSC 104, Lecture 0514 Working with large numbers l Humans can’t work well with binary numbers - there are too many digits to deal with. We will make errors. l Memory addresses and other data can be quite large. Therefore, we sometimes use the hexadecimal number system (shorthand for binary that’s easier for us to work with)

CMSC 104, Lecture 0515 The Hexadecimal Number System l The hexadecimal number system is also known as base 16. The values of the positions are calculated by taking 16 to some power. l Why is the base 16 for hexadecimal numbers ? oBecause we use 16 symbols, the digits 0 and 1 and the letters A through F.

CMSC 104, Lecture 0516 The Hexadecimal Number System (con’t) Binary Decimal Hexadecimal A B C D E F

CMSC 104, Lecture 0517 The Hexadecimal Number System (con’t) l Example of a hexadecimal number and the values of the positions: 3 C 8 B

CMSC 104, Lecture 0518 Binary to Hexadecimal Conversion Binary Hex Written:

CMSC 104, Lecture 0519 What is Hexadecimal really ? Binary Hex A number expressed in base 16. It’s easy to convert binary to hex and hex to binary because 16 is 2 4.

CMSC 104, Lecture 0520 Another Binary to Hex Conversion Binary Hex 7 C 3 F 7C3F 16

CMSC 104, Lecture 0521 Summary of Number Systems l Binary is base 2, because we use two digits, 0 and 1 l Decimal is base 10, because we use ten digits, 0 through 9. l Hexadecimal is base 16. How many digits do we need to express numbers in hex ? 16 (0 through F: A B C D E F)

CMSC 104, Lecture 0522 Example of Equivalent Numbers Binary: Decimal: Hexadecimal: 50A7 16 Notice how the number of digits gets smaller as the base increases.