Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bits, Nybbles, Bytes, numbers and characters

Similar presentations


Presentation on theme: "Bits, Nybbles, Bytes, numbers and characters"— Presentation transcript:

1 Bits, Nybbles, Bytes, numbers and characters
Brian Mapes MPO581 Jan 24, 2011 from googling and poaching

2 Data Types bit - a 0 or 1. Can represent 2 unique values
byte - 8 bits values to 128 unsigned byte - 8 bits to 256 character – an alphabet-mapped byte short int - 16 bits to 32767 long int – 32 bits ,294,967,296 values float - 32 bits coded: mantissa,exp double - 64 bits coded word – machine dependent. 32 or 64 bits

3 Binary Equivalents of Decimal Numbers
Decimal Binary (LR) Binary (R L) etc. Is “most significant bit” (MSB) at “right” or “left”? (right and left are arbitraryin computer chip memory space)

4 Powers of 2 Decimal Decimal 20 1 28 256 21 2 29 512 22 4 210 1024

5 Decimal (base 10) numbers
A decimal number can be represented as the sum of powers of 10 (the base) with coefficients in the base 10 alphabet (0 - 9) For example: 2485 = 2485 = 2 * * * * 1 2485 = 2 * * * * 100 Same principle can be applied in binary...

6 Hexadecimal Numbers (nybbles or half-bytes)
4 bits  Base-16 number system Uses digits and letters A - F One hexadecimal digit can express values from 0 to 15 For example: C represents 12 (Not important for us - Used in memory addressing, sometimes wifi passwords,...)

7 Hexadecimal - Binary Equivalents
Hex Binary Hex Binary A B C D E F

8 Characters and strings
EBCDIC, Extended Binary Coded Decimal Interchange Code Used by IBM in mainframes (360 architecture and descendants). Earliest system ASCII, American Standard Code for Information Interchange. Most common system Unicode, New international standard Variable length encoding scheme with either 8- or 16-bit minimum “a unique number for every character, no matter what the platform, no matter what the program, no matter what the language.” EBCDIC - 8 bit ASCII - 7 bit, 128 characters EBCDIC - Extended Binary Coded Decimal Interchange Code Unicode - uses a default 16-bit encoding, but includes extensions that permit over 900,000 additional characters. It offers two Unicode Transformation Formats, UTF-8 and UTF-16, variable length encoding schemes with, respectively, 8- and 16-bit minimum length codes. UTF-8 is compatible with ASCII. CSE360

9 The Unicode Character Set
Each character stored as 16-bits Maximum number of characters that can be represented: 65,536 (216) ASCII character set (used by many programming languages) stores each character as 7 bits (maximum number of characters is 128). For compatibility, first 128 characters of Unicode set represent the ASCII characters

10 Some Unicode Characters
Unicode Character Decimal Value * A B a b }

11 Bytes as the “element” of data
Memory: Can be viewed as an array of storage elements. The index of each element is called the address. Each element holds the same number of bits. How many bits per element? 8, 16, 32, 64? 8 (Byte) is typical Words are about the processor: how many bytes are loaded into a register and processed at once? 32-bit word common, 64-bit  faster double math 1 2 ... n-1 8 bits = 1 byte 16 bits 32 bits 64 bits It is not the size of the addressable element that depends on the size of the data bus, but, rather, the size of the word. The number of addressable elements depends on the size of the address bus. SPARC has a 32 bit word; a word is not always 32 bits. Mention the phrase “?-bit addressable”. SPARC’s memory is 8-bit addressable, i.e., byte addressable.

12 Single precision

13 Charles Babbage 1791-1871 Lucasian Professor of Mathematics, Cambridge University, 1827-1839
1/20/2009 CS152-Spring’09 CS252 S05

14 The first programmer Ada Byron aka “Lady Lovelace” 1815-52
Ada’s tutor was Babbage himself! 1/20/2009 CS152-Spring’09 CS252 S05

15 Babbage’s Influence Babbage’s ideas had great influence later primarily because of Luigi Menabrea, who published notes of Babbage’s lectures in Italy Lady Lovelace, who translated Menabrea’s notes in English and thoroughly expanded them. “... Analytic Engine weaves algebraic patterns....” In the early twentieth century - the focus shifted to analog computers but Harvard Mark I built in 1944 is very close in spirit to the Analytic Engine. 1/20/2009 CS152-Spring’09 CS252 S05

16 A Hierarchy of Languages
Application Programs High-Level Languages Assembly Language Machine Language Hardware High-Level Language Low-Level Language Machine independent Machine specific

17 Bit depths in color 16 bits per pixel (high color)
5 bits for red, 5/6 bits for green, 5 bits for blue potential of 32 reds, 32/64 green, 32 blues total colors: 65536 32 bits per pixel (true color) 8 bits for red, green, blue, and alpha potential for 256 reds, greens, and blues total colors: (more than the eye can distinguish)


Download ppt "Bits, Nybbles, Bytes, numbers and characters"

Similar presentations


Ads by Google