Week 2 - Data Representation - Stud
Week 2 - Data Representation - Stud
Data Representation
in
Computer Systems
1
Chapter 2 Objectives
2
Introduction
5
Decimal to Binary Conversions
6
Decimal to Binary Conversions
8
Signed Integer Representation
In this example, we were careful to pick two values whose sum would
9
fit into seven bits. If that is not the case, we have a problem.
Signed Integer Representation
• Example:
– Using signed magnitude binary
arithmetic, find the sum of 107
and 46.
• We see that the carry from the
seventh bit overflows and is
discarded, giving us the
erroneous result: 107 + 46 = 25.
10
Signed Integer Representation
11
Signed Integer Representation
12
Signed Integer Representation
13
Signed Integer Representation
14
Signed Integer Representation
15
Signed Integer Representation
16
Signed Integer Representation
18
Floating-Point Representation
19
Floating-Point Representation
20
Character Codes
• Computers map characters to bit patterns
(unsigned integers effectively). The most
common mappings in use are ASCII12
(pronounced as-key) and Unicode. An older
mapping is IBM’s EBCDIC.
• ASCII uses 7-bits (128 bit patterns) although
most computers extend this to 8 bits yielding an
extra 128 bit-patterns.
21
The 7-bit ASCII Character Set
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00 NUL SOH STX ETX EOT ENQ ACK BEL BS TAB LF VT FF CR SO SI
10 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
20 ! " # $ % & ' ( ) * + , - . /
30 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
40 @ A B C D E F G H I J K L M N O
50 P Q R S T U V W X Y Z [ \ ] ^ _
60 ` a b c d e f g h i j k l m n o
70 p q r s t u v w x y z { | } ~ DEL
22
The 7-bit ASCII Character Set
24
Chapter 2 Conclusion
25