HEXADECIMAL NUMBERS.

Slides:



Advertisements
Similar presentations
Computer Science 101 RGB Color System. Simplified Introduction to Color Vision Go to How We See: The First Steps of Human Vision or Color Vision for more.
Advertisements

© 2004, Robert K. Moniot Binary and Hex How to count like a computer.
Base Conversion COP Practice Problem  Print a String in reverse order:  For example, if we want to print “HELLO” backwards,  we first print:
Candidates should be able to:
1 3 Computing System Fundamentals 3.5 Data Representation.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
Hexadecimal In today’s lesson we will look at: the need for something other than binary how hexadecimal works how to convert between hexadecimal and binary.
Connecting with Computer Science, 2e
Binary Representation
Chapter 4.2 Binary numbers: Arithmetic
Copyright (c) 2004 Professor Keith W. Noe Number System & Codes Number Conversions Part II.
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
Contains 16,777,216 Colors. My Car is red My Car is red How do I add colors to my web page? Notepad Browser Works with the “Standard” colors: Red, Green,
CS110: Computers and the Internet Color and Image Representation.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
© 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.
Digital Colour Theory. What is colour theory? It is the theory behind colour mixing and colour combination.
Chapter 16 Binary and Hexadecimal Numbers. §16.2 thru 16.3 – Addition and Subtraction of Binary Numbers Binary = Base 2 Addition and subtraction are similar.
Real Numbers and the Decimal Number System
©Brooks/Cole, 2003 Chapter 2 Data Representation.
CMYK vs. RGB Design. Primary colors The colors that make up the base for every other color created. Depending on whether you are looking at it from science,
What are the five colors in the legend? Enter the information below (5 points) 0000FF = = FFFFFF = 00FF00 = FF0000 = Color Theory Legend: income.
Number Systems CIT Network Math
Hexadecimal Codes 1. RGB Color Wheel 2 Before we begin Hexadecimal is a number system Based on using 0 – F to represent 0 – 15 Hex is used to represent.
Applying Color in CSS Web Design – Sec 4-5 Part or all of this lesson was adapted from the University of Washington’s “ Web Design & Development I ” Course.
Lecture 2 Bits, Bytes & Number systems
Chapter 4: Representation of data in computer systems: Number OCR Computing for GCSE © Hodder Education 2011.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
Working with 8-bit bytes and hexadecimal
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
Data Representation Hexadecimal  Although computers work in binary it is sometimes inconvenient for humans to read everything in Binary. For example in.
# Red Green Blue Digital Color RGB to HEX.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Candidates should be able to:
Announcements Chapter 8 for today. 2 More Digitization Light, Sound, Magic: Representing Multimedia Digitally © Lawrence Snyder, 2008.
BINARY Toby Wilson. LEARNING OBJECTIVES  Be able to convert binary to denary  Be able to convert denary into binary  Be able to explain how computers.
Computer Science 4 On and OFF. Homework What have we created.
DATA REPRESENTATION IMAGES GCSE Computing. Learning Objective ■ To understand how an image is represented in Binary ■ To be able to convert a Binary code.
ABFC... Home page Introduction Binary number system Hexadecimal number system Binary coded decimal Objectives Octal number system Click.
Introduction to Number Representation A451 GCSE Computing.
The Hexadecimal Number System Representation of Data in Computer Systems.
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.
What do you think this lesson is all about? Write your answer on a sticky note.
WHY HEXADECIMAL?. Why bother with Hexadecimal? 1. Binary numbers are difficult for us to work with. 2. Hexadecimal can be used as “shorthand” for binary.
Unit 2.6 Data Representation Lesson 3 ‒ Images
Searching Binary and Hexadecimal numeral systems
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Hexadecimal Sweet Sixteen!.
Chapter 13 Colors & backgrounds.
Binary and Hexadecimal
Lec 3: Data Representation
Unit 18: Computational Thinking
4.01 HTML, CSS and Color.
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Lesson objectives Understand how computers represent and manipulate numbers [unsigned integers, signed integers (sign and magnitude, Two’s complement)
What do these words mean to you?
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Hexadecimal Conversions
Hexadecimal Binary Made Easier.
Topic 3: Data Hexadecimal.
Chapter 2 Data Representation.
(return of the…) Data blast
Lesson 4: Introduction to Hexadecimal
GCSE COMPUTER SCIENCE Topic 3 - Data 3.4 Hexadecimal Conversion.
Hexadecimal.
LO1 – Understand Computer Hardware
ENEL 111 Digital Electronics
Presentation transcript:

HEXADECIMAL NUMBERS

OBJECTIVES Be able to explain what a hexadecimal number is Be able to convert up to denary 255 to hexadecimal and vice versa Understand and be able to explain why we use hexadecimal

Binary Numbers Here are the first 16 binary numbers (using 4 bits), and their decimal equivalents. Copy this chart. binary denary hexa-decimal 0000 1000 8 0001 1 1001 9 0010 2 1010 10 0011 3 1011 11 0100 4 1100 12 0101 5 1101 13 0110 6 1110 14 0111 7 1111 15 © 2004, Robert K. Moniot

Activity Complete the chart by writing the first 16 hexadecimal numbers (beginning with 0) How many bits do you need to represent the first 16 hexadecimal numbers? binary denary hexa-decimal 0000 1000 8 0001 1 1001 9 0010 2 1010 10 A 0011 3 1011 11 B 0100 4 1100 12 C 0101 5 1101 13 D 0110 6 1110 14 E 0111 7 1111 15 F

Converting hex to denary and back again (up to denary 255) We naturally understand denary numbers We know that 1089 = (1x1000)+(0x100)+(8x10)+(9x1) For hexadecimal it is the same but for base 16 For example: A9 (10x16)+(9x1) = 160 + 9 = 169 10 9

Convert these hexadecimal numbers to denary – show working FF AC 8D 99 EE 42 EXTRA CHALLENGE – TRY THESE : FFFF, EEF4, CBCB, 0101, DDFF

Convert these hexadecimal numbers to denary – ANSWERS FF = (15 X 16) + (15 X 1) = 240 + 15 = 255 AC = (10 X 16) + (12 X 1) = 160 + 12 = 172 8D = (8 X 16) + (13 X 1) = 128 + 13 = 141 99 = (9 X 16) + (9 X 1) = 144 + 9 = 153 EE = (14 X 16) + (14 X 1) = 224 + 14 = 238 42 = (4 X 16) + (2 X 1) = 64 + 2 = 66

THE GOOD NEWS For the purposes of GCSE you need to be able to convert denary 255 to hexadecimal and back again (2 hexadecimal digits)

DENARY TO HEXADECIMAL How would you convert 200 denary to hexadecimal? Divide 200 by 16 = 12 (lots of 16) remainder 8 (units) 12 as a hex = C and 8 is 8 Answer is C8

Convert these denary to hexadecimal 32 255 59 159 230

Binary and Hexadecimal Hexadecimal works by grouping binary bits into groups of 4 (starting from the right). Each group (a nibble) is assigned a hex digit value. The digits are the same as for decimal up to 9, and then letters A through F are used for 10 through 15. 0000 = 0 1000 = 8 0001 = 1 1001 = 9 0010 = 2 1010 = A 0011 = 3 1011 = B 0100 = 4 1100 = C 0101 = 5 1101 = D 0110 = 6 1110 = E 0111 = 7 1111 = F Thus the 8-bit binary number 1011 0010 converted to hex is B2 © 2004, Robert K. Moniot

What would these binary numbers be as hexadecimal? 11111111 00000000 10101010 01011111 11110000 Extension – write the proof by converting each to denary

Which of these is easier to remember? 01011011 01011011 or 5B5B Humans are not good at remembering long strings of numbers and binary numbers are often long and unwieldy

Why hexadecimal? Hex numbers are shorter/more memorable than equivalent binary numbers.. ... and can easily be converted to and from binary... ... as each hexadecimal digit corresponds to 4 binary digits

USES OF HEXADECIMAL Used in error messages Representation of colours in images and HTML Challenge! – what other uses of hexadecimal in computing can you find? © 2004, Robert K. Moniot

The RGB Color System RGB values are based on the Red, Green, Blue primary color system. Each of the three primary colors is assigned a numerical strength. The three strengths of Red, Green, and Blue define the color. © 2004, Robert K. Moniot

Expressing Colors in Hex Strengths of the primary colors are defined using 8-bit numbers (bytes). An 8-bit number can be represented using two hex digits. The value of the hex number ranges from 00 to FF, corresponding to a range from 0 to 255 decimal. A strength of 00 means the color is completely absent. A strength of FF or 255 means the color is at its maximum. An RGB color is thus represented by three 8-bit numbers (bytes), or six hex digits. © 2004, Robert K. Moniot

Expressing Colors in Hex Note that 40 is ¼ of full strength, 80 is ½, C0 is ¾. Here are some examples of colors expressed in hex: "#000000" Black (all colors off) (what do you think white is?) "#FFFFFF" White (all colors max) "#FF0000" Red (red max, green & blue off) "#00FF00" Green "#0000FF" Blue "#FFFF00" Yellow (equal amounts of red & green) "#AEEEEE" Turquoise "#808080" Gray (all colors half max) © 2004, Robert K. Moniot

ACTIVITY Open notepad Type in: <body bgcolor=#ff0000> Save the file with the extension .htm. Make sure not to save as a .txt file. Double-click on the file to open with your default browser. Now repeat the process with different colour codes.

HEXADECIMAL BINGO Highlight the decimal equivalent of the hexadecimal number given