01 2 CH7
01 2 CH7
• CS170
• Computer Applications for Business
1
2
Chapter 7 – Digital Information
3
Data 01001000 01100101
01101100 01101100
01101111 00101100
00100000 01110111
01101111 01110010
01101100 01100100
00100001
Digitizing information
◦ data represented as numbers
the breakthrough!
machines reading digital info
6
A Binary System
• The PandA encoding
has two patterns:
present and absent
• Two patterns make it a
binary system
• There is no law that
says on means
“present” or off means
“absent”
• The PandA unit is
https://code.org/educate/resou
known as a binary digit rces/videos BINARY and DATA
or bit
7
Bits in Computer Memory
• Memory is arranged inside a computer in a
very long sequence of bits
• The physical phenomenon can be encoded,
the information can be set and detected to
present or absent
9
Hex Explained
• Hex digits, short for hexadecimal digits,
are base-16 numbers
• Uses decimal numbers, and then the first
six Latin letters
– 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
• There needed to be a better way to write
bit sequences…hexadecimal digits
http://www.asciitable.com/
10
Changing Hex to Binary
• The 32 bits below represent a
computer instruction
1000 1110 1101 1000 1010 0011 1010 0000
• Writing so many 0’s and 1’s is tedious
and error prone
• We can convert each four-bit group to
hex, giving the shorter version:
8ED8A3A0
11
Hexadecimal Digits
12
Digitizing Text
• We need to represent:
–26 uppercase,
–26 lowercase letters,
–10 numerals,
–20 punctuation characters,
–10 useful arithmetic characters,
– 3 other characters (new line, tab, and backspace)
–95 symbols…enough for English
13
Assigning Symbols
• ASCII stands for American Standard Code for
Information Interchange
• Advantages of a “standard”?
15
Data Encoding
• HELLO
• (human readable)
• 48-45-4C-4C-4F
• (ASCII encode - Hex)
• 0100 1000-0100 0101-0100 1100-0100 1100-0100 1111
• (machine language)
16
Unicode
17
Conversion
Chart
Binary to Hex
Hex to Binary
http://www.asciitable.com/
(A = 65)
18
Decimal vs. Binary
231 Base 10 128 64 32 16 8 4 2 1
2x100 3x10 1x1
2x102 3x101 1x100 1 1 1 0 01 11
1x27 1x26 1x25 0x24 0x23 1x22 1x21 1x20
128 + 64 + 32 + 0 + 0 + 4 + 2 + 1
= 64 + 0+ 0+ 8+ 0+ 0+ 0
= 72
20
Converting – From Decimal
• Decimal to Hexadecimal
• 72 divided by 16 = 4 with the remainder of 8
• 4 divided by 16 = 0 with the remainder of 4
• = 48
• Decimal to Binary
• 72 divided by 2 = 36 with the remainder of 0
• 36 divided by 2 = 18 with the remainder of 0
• 18 divided by 2 = 9 with the remainder of 0
• 9 divided by 2 = 4 with the remainder of 1
• 4 divided by 2 = 2 with the remainder of 0
• 2 divided by 2 = 1 with the remainder of 0
• 1 divided by 2 = 0 with the remainder of 1
• = 1001000
21
Let’s try some
Base 10 Base 2 Base 16
129
10110111
56
8C
C5
11001011
22
Metadata
23
Chapter 7 – Digital Information
24