DLCA-Data Representation
DLCA-Data Representation
M. Morris Mano
PRENTICE HALL
Computer System Architecture Chap. 3 Data Representation Ref: bazi.pe.kr
Data Types 2 / 23
Data Types
Binary information is stored in memory or processor registers
Registers contain either data or control information
Data are numbers and other binary-coded information
Control information is a bit or a group of bits used to specify the sequence
of command signals
Data types found in the registers of digital computers
Numbers used in arithmetic computations
Letters of the alphabet used in data processing
Other discrete symbols used for specific purpose
The binary number system is the most natural system to use in a digital
computer
Number Systems
Base or Radix r system : uses distinct symbols for r digits
Most common number system :Decimal, Binary, Octal, Hexadecimal
Positional-value(weight) System : r2 r 1r0.r-1 r-2 r-3
» Multiply each digit by an integer power of r and then form he sum of all weighted
digits
Integer = 41
41 / 2 = 20 remainder 1 (binary number will end with 1) : LSB
20 / 2 = 10 remainder 0
10 / 2 = 5 remainder 0
5 / 2 = 2 remainder 1
2 / 2 = 1 remainder 0
1 / 2 = 0 remainder 1 (binary number will start with 1) : MSB
Read the result upward to give an answer of (41) 10 = (101001)2
Fraction = 0.6875
0.6875 x 2 = 1.3750 integer 1 : MSB
1.3750 x 2 = 0.7500 integer 0 .
0.7500 x 2 = 1.5000 integer 1
1.5000 x 2 = 1.0000 integer 1 : LSB
Read the result downward (0.6875)10 = (0.1011)2
9F216 = 9 F 2 1 1 1 0 1 0 0 1 1 02 = 0 0 1 1 1 0 1 0 0 1 1 0
Binary, octal,
1 and
2 hexadecimal
7 5 Conversion
4 3
Octal
Binary
1 0 1 0 1 1 1 1 0 1 1 0 0 0 1 1
Hexadecimal
A F 6 3
Binary-Coded-Decimal Code
Each digit of a decimal number is represented by its binary equivalent
8 7 4 (Decimal)
N : given number
(r-1)’s Complement r : base
(r-1)’s Complement of N = (rn-1)-N n : number of digits
Overflow
An overflow may occur if the two numbers added are both positive or both
negative
» When two unsigned numbers are added
BCD 코드를 연산 하려면 an overflow is detected from the end carry out of the MSB position
특별한 연산기가
» When two signed numbers are added * Overflow Exam)
필요하다
out in out in
the MSB always represents the sign
carries 0 1 carries 1 0
- the sign bit is treated as part of the number
+ 70 0 1000110 - 70 1 0111010
- the end carry does not indicate an overflow
+ 80 0 1010000 - 80 1 0110000
Overflow Detection
+ 150 1 0010110 - 150 0 1101010
Detected by observing the carry into the sign bit position and the carry out of
the sign bit position
If these two carries are not equal, an overflow
*Decimal Exam) (+375) + (-240)
condition is produced(Exclusive-OR gate = 1) 375 + (10’s comp of 240)= 375 + 760
Decimal Fixed-Point Representation
0 375 (0000 0011 0111 0101)
A 4 bit decimal code requires four F/Fs +9 760 (1001 0111 0110 0000)
* Advantage * for each decimal digit 0 135 (0000 0001 0011 0101)
Computer I/O data The representation of 4385 in BCD requires 16 F/Fs (0100 0011 1000 0101)
are generated by
people who use The representation in decimal is wasting a considerable amount of storage
the decimal space and the circuits required to perform decimal arithmetic are more complex
system
Gray Code
Gray code changes by only one bit
Transmitter Receiver
~
Parity Bit
An extra bit included with a binary message to make the total number of 1’s
either odd or even(Tab. 3-7)
Even-parity method
The value of the parity bit is chosen so that the total number of 1s (including
the parity bit) is an even number
1 1 0 0 0 0 1 1
Added parity bit
Odd-parity method
Exactly the same way except that the total number of 1s is an odd number
1 1 0 0 0 0 0 1
Added parity bit
Parity Generator/Checker
At the sending end, the message is applied to a parity generator
At the receiving end, all the incoming bits are applied to a parity checker
1 1 0 0 0 0 1 1 “C” 1 1 0 0 0 0 1 0 ”B”
(Even-parity Generator) (Even-parity Checker)
Next Page
☞ Parity check
Error 검출용 비트를 하나 더 추가 시켜서 언제나 전체 부호 속에 포함 되어 있는
1 의 수가 홀수 또는 짝수개가 되도록 하는 것
10 진수 23 22 21 20 패리티비트 1 의 합계
0 0 0 0 0 1 1
1 0 0 0 1 0 1
2 0 0 1 0 0 1
3 0 0 1 1 1 3
4 0 1 0 0 0 1
5 0 1 0 1 1 3
6 0 1 1 0 1 3
7 0 1 1 1 0 3
8 1 0 0 0 0 1
9 1 0 0 1 1 3
Computer System Architecture Chap. 3 Data Representation
3-6. Error Detection Codes 21 / 23
☞ Word parity
코드를 한 묶음 단위로 하는 Block 단위 , 에러 검출은 물론 정정 까지도 가능 하다
Odd parity bit
0 1 1 1 1 0 0 1 0 1 1 1 1 0 0 1
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1
1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 1 Parity Error 검출 ( 짝수
)
0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0
0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1
0 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0
1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1
1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0