We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byGabriela Axson
Modified about 1 year ago
© 2004, Robert K. Moniot Binary and Hex How to count like a computer
© 2004, Robert K. Moniot Why Binary? The basic unit of storage in a computer is the bit (binary digit), which can have one of just two values: 0 or 1. This is easier to implement in hardware than a unit that can take on 10 different values. –For instance, it can be represented by a transistor being off (0) or on (1). –Alternatively, it can be a magnetic stripe that is magnetized with North in one direction (0) or the opposite (1). Binary also has a convenient and natural association with logical values of False (0) and True (1).
© 2004, Robert K. Moniot Building on Binary Binary bits are grouped together to allow them to represent more information: –A nybble is a group of 4 bits, e.g. 1011 –A byte is a group of 8 bits, e.g. 11010010 –A word is a larger grouping: usually 32 bits. A halfword is half as many bits as a word, thus usually 16 bits. A doubleword is twice as many bits, usually 64 bits. However, computers have been designed with various word sizes, such as 36, 48, or 60 bits. Clearly, the number of possible combinations of a group of N bits is 2 N = 2x2x2 … x2 (N 2s). Thus: –A nybble can form 2 4 =16 combinations –A byte can form 2 8 =256 combinations –A 32-bit word can form 2 32 =4,294,967,296 combinations
© 2004, Robert K. Moniot Building on Binary Each combination of a group of bits can be assigned a symbolic meaning. For instance, bytes can be used to represent text by associating each byte value with a character. For example, the ISO-8859-1 character encoding (an extension of the older ASCII code) assigns the value 00101110 to mean a period (‘.’), 01000001 to mean capital ‘A’, and so on. It is also possible to represent numbers using binary. The binary numbering system is like the decimal system, except that the only two digits used are 0 and 1, and digits are multiplied by powers of 2 instead of 10.
© 2004, Robert K. Moniot Decimal and Binary Numbers In the decimal system, each digit has a weight that is 10 times the weight of its neighbor to the right. Thus: 1234 = (((1x10 + 2)x10 + 3)x10) + 4 Similarly, in a binary number, each digit has a weight that is 2 times the weight of its neighbor to the right. Thus: 1011 = (((1x2 + 0)x2 + 1)x2 + 1 Expressing this in decimal it is ((2x2 + 1)x2 + 1 = 5x2 + 1 = 11.
© 2004, Robert K. Moniot Binary Numbers 0000 = 01000 = 8 0001 = 11001 = 9 0010 = 21010 = 10 0011 = 31011 = 11 0100 = 41100 = 12 0101 = 51101 = 13 0110 = 61110 = 14 0111 = 71111 = 15 Here are the first 16 binary numbers (using 4 bits), and their decimal equivalents.
© 2004, Robert K. Moniot Binary and Hexadecimal Because binary numbers are rather unwieldy, programmers prefer to use a more compact way to represent them. Historically, octal (base 8) and hexadecimal (base 16, or hex) have been used. –Octal has the advantage that it uses only familiar digits, but it groups digits by threes, which is inconvenient for word sizes that are multiples of 4. So it is seldom used nowadays. –Hexadecimal works nicely for bytes and for word sizes that are multiples of 4, but requires the introduction of 6 new digits. Conversion between binary and decimal is slow and is preferably avoided if there is no need. Octal and hex allow immediate conversion to and from binary.
© 2004, Robert K. Moniot Binary and Hexadecimal 0000 = 01000 = 8 0001 = 11001 = 9 0010 = 21010 = A 0011 = 31011 = B 0100 = 41100 = C 0101 = 51101 = D 0110 = 61110 = E 0111 = 71111 = F Hexadecimal works by grouping binary bits into groups of 4 (starting from the right). Each group (a nybble) 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. Thus the 16-bit binary number 1011 0010 1010 1001 converted to hex is B2A9
© 2004, Robert K. Moniot The RGB Color System HTML styles define only 16 colors that are guaranteed to be recognized by name. Most browsers recognize many other color names, but there is no guarantee. So many web developers use “RGB” values to define colors. RGB values are based on the Red, Green, Blue primary color system. Just about every color that the human eye can perceive can be represented by a combination of specific amounts of each primary color. To define colors numerically, 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 It is convenient to define the strengths of the primary colors using 8-bit numbers, or 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 0 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, or six hex digits. In HTML, a value is signified as hexadecimal by prefixing it with a ‘#’ sign. For example, "#E703A0" would be such a value.
© 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) "#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)
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.
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,
Bases and Number Representation Reading: Chapter 2 (14 – 27) from the text book 1.
Announcements Chapter 8 for today. 2 More Digitization Light, Sound, Magic: Representing Multimedia Digitally © Lawrence Snyder, 2008.
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
1 Binary Representation The basis of all digital data is binary representation. Binary - means ‘two’ –1, 0 –True, False –Hot, Cold –On, Off We must be.
© Maths Support Service 2007 Binary and Hexadecimal Numbers Next Slide AE98FD AE98FD.
Computers Organization & Assembly Language Continue of Ch-1 Data Representation.
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.
Logical Circuit Design Week 2,3: Fundamental Concepts in Computer Science, Binary Logic, Number Systems Mentor Hamiti, MSc Office: ,
Number systems Jaana Holvikivi Metropolia. Result AND OR NOT Logical operations Boolean algebra Operations &&AND.
ENEL 111 Digital Electronics Richard Nelson G.1.29
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.
Number Systems by Dr. Amin Danial Asham. References Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Number Systems CIT Network Math
Connecting with Computer Science, 2e Chapter 7 Numbering Systems and Data Representations.
CS 111 – Sept. 3 More data representation Review hex notation Text –ASCII and Unicode Sound and images Commitment: –For Wednesday: Please read pp
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
ABFC... Home page Introduction Binary number system Hexadecimal number system Binary coded decimal Objectives Octal number system Click.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
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.
RGB to HEX Digital Color RedGreenBlue #. Color Pixels Each pixel composed red, green and blue phosphers with black mask. Each channel of the RGB.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
The Hexadecimal Number System and Memory Addressing ISAT 121.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Number Systems. Decimal Numbers Decimal stands for 10 Decimal is the base 10 Number System It has 10 unique symbols The largest symbol.
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.
Data Representation COE 205 Computer Organization and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering King Fahd University.
Data Representation Computer Organization & Assembly Language Programming Dr Adnan Gutub aagutub ‘at’ uqu.edu.sa [Adapted from slides of Dr. Kip Irvine:
What are the five colors in the legend? Enter the information below (5 points) 0000FF = = FFFFFF = 00FF00 = FF0000 = Color Theory Legend: income.
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,
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.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh College of Computer Sciences and Engineering King Fahd University of Petroleum and.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Chapter 7—Objects and Memory The Art and Science of An Introduction to Computer Science ERIC S. ROBERTS Java Objects and Memory C H A P T E R 7 Yea, from.
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.
Web Colors. Web Colors: Up until now, we have been using only pre- defined color names, such as "orange" and "lightblue". As web designers, we need the.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
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,
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
EET 250 Number systems. Introduction to Number Systems While we live in a world where the decimal number is predominant in our lives, computers and digital.
Computer Science 101 Number Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
CIS 234: Numbering Systems Dr. Ralph D. Westfall April, 2010.
BR 8/99 Digital Devices Integrated Circuits that operate on Digital Data are in 95% of every electrical powered device in the U.S. The theory of operation.
Review of HTML Ch. 1. Review of tags covered various header tags Img tag Style, attributes and values alt.
Information and Programs. Foundations of Computing Information –Binary numbers –Integers and Floating Point –Booleans (True, False) –Characters –Variables.
© 2017 SlidePlayer.com Inc. All rights reserved.