CSC 2400 Announcements
q HW 1 assigned (Due Wednesday) q Sign up for Piazza (30/47)
CSC 2400 Announcements q HW 1 assigned (Due Wednesday) q Sign up for - - PowerPoint PPT Presentation
CSC 2400 Announcements q HW 1 assigned (Due Wednesday) q Sign up for Piazza (30/47) CSC 2400: Computer Systems Number Systems Analog vs. Digital System q Analog Signals - Value varies continuously q Digital Signals - Value limited to a finite set
q HW 1 assigned (Due Wednesday) q Sign up for Piazza (30/47)
q Analog Signals
q Digital Signals
q Binary Signals
q Computers are built using digital circuits
q Can represent many kinds of information
q A single binary input can have two values: 1 or 0 q More bits = more combinations
q How many values can you represent on 3 bits? q What about n bits?
q How do you figure out what the value of 1110two is?
q Decimal (base 10)
q Binary (base 2)
q How do you figure out what the value of 1110two is?
q Decimal (base 10)
q Binary (base 2)
1 10 11 _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____
0 = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = 10 = 11 = 12 = 13 = 14 = 15 = 16 = 17 = 18 =
Base 10 Base 2
1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000 10001 10010
0 = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = 10 = 11 = 12 = 13 = 14 = 15 = 16 = 17 = 18 = 0000 0000 000 000 00 00 00 00
Base 10 Base 2
q Sum up (bit*weight):
q Sum up (bit*weight):
q Memorize!
2 {0,1} 3 {0,1,2} 4 {0,1,2,3} 5 {0,1,2,3,4} 6 {0,1,2,3,4,5} 7 {0,1,2,3,4,5,6} 8 {0,1,2,3,4,5,6,7} 9 {0,1,2,3,4,5,6,7,8} 10 {0,1,2,3,4,5,6,7,8,9} 11 {0,1,2,3,4,5,6,7,8,9,A} 12 {0,1,2,3,4,5,6,7,8,9,A,B} 13 {0,1,2,3,4,5,6,7,8,9,A,B,C} 14 {0,1,2,3,4,5,6,7,8,9,A,B,C,D} 15 {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E} 16 {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
1 2 3 4 5 6 7 10 __ __ __ __ __ __ __ __ __ __
0 = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = 10 = 11 = 12 = 13 = 14 = 15 = 16 = 17 = 18 =
Base 10 Base 8
1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22
0 = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = 10 = 11 = 12 = 13 = 14 = 15 = 16 = 17 = 18 = 00 00 00 00 00 00 00 00
Base 10 Base 8
q Sum up (digit*weight):
q Sum up (digit*weight):
1 2 3 4 5 6 7 8 9 A B C D E F 10 __ __
0 = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = 10 = 11 = 12 = 13 = 14 = 15 = 16 = 17 = 18 =
Base 10 Base 16
1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12
0 = 1 = 2 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = 10 = 11 = 12 = 13 = 14 = 15 = 16 = 17 = 18 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Base 10 Base 16
q Sum up (hex digit*weight):
q Sum up (hex digit*weight):
q Use the Placement Method
q Use the Placement Method
q It is often convenient to write binary (base-2) numbers
0000 0001 1 1 0010 2 2 0011 3 3 0100 4 4 0101 5 5 0110 6 6 0111 7 7
1000 8 8 1001 9 9 1010 A 10 1011 B 11 1100 C 12 1101 D 13 1110 E 14 1111 F 15
q Every four bits is a hex digit
This is not a new machine representation, just a convenient way to write the number
q Every four bits is a hex digit.
This is not a new machine representation, just a convenient way to write the number
10 0110 1110 1001 0100 1100 0101 11112
0111 1010 ____ ____ ____ ____ ____ ____ 0010 0110 1110 1001 0100 1100 0101 1111 6 __ __ __ __ __ __ 2 7 A 8 B F 7 D 6
10 0110 1110 1001 0100 1100 0101 11112
0111 1010 1000 1011 1111 0111 1101 0110 0010 0110 1110 1001 0100 1100 0101 1111 6 E 9 4 C 5 F 2 7 A 8 B F 7 D 6
10 111 010 100 110 001 011 1112
010 111 010 100 110 001 011 111 __ __ __ __ __ __ __ 2
10 111 010 100 110 001 011 1112
010 111 010 100 110 001 011 111 7 2 4 6 1 3 7 2
q The binary, hexadecimal (hex) and octal system share
q Each digit in the hex system is equivalent to a four-digit
q From right to left, we add each pair of digits q We write the sum, and add the carry to the next column
q Hex addition is similar to decimal addition except that each
q Examples:
q From right to left, we add each pair of bits
q We write the sum, and add the carry to the next column
q Number Systems
q Arithmetic Operations
q If you subtract a larger digit from a smaller digit, borrow 10 (ten)
10
q Hex subtraction is similar to decimal subtraction except that if
q Examples:
13
15 12
q Similar to decimal subtraction q If you subtract 1 from 0, “borrow” 2 (10 binary) from the
q Examples:
10
10 1 10