Email Presentation to Friend

Embed Code

Binary and Hex PowerPoint PPT Presentation

Binary and Hex. How to count like a computer. 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.

Copyright Complaint Adult Content Flag as Inappropriate

Download Presentation

Binary and Hex

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

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 2N = 2x2x2 … x2 (N 2s). Thus:

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.

Binary and Hexadecimal

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.

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.

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.