Microsoft PowerPoint - CHAP-03 [호환 모드]

Similar documents
step 1-1

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

<3130C0E5>

Stage 2 First Phonics

Microsoft PowerPoint - AC3.pptx

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

untitled

Microsoft PowerPoint - ch03ysk2012.ppt [호환 모드]

public key private key Encryption Algorithm Decryption Algorithm 1

IKC43_06.hwp

- 2 -

Microsoft PowerPoint - CHAP-01 [호환 모드]

#Ȳ¿ë¼®

Hi-MO 애프터케어 시스템 편 5. 오비맥주 카스 카스 후레쉬 테이블 맥주는 천연식품이다 편 처음 스타일 그대로, 부탁 케어~ Hi-MO 애프터케어 시스템 지속적인 모발 관리로 끝까지 스타일이 유지되도록 독보적이다! 근데 그거 아세요? 맥주도 인공첨가물이

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

¹Ìµå¹Ì3Â÷Àμâ


hwp

Microsoft PowerPoint - 7-Work and Energy.ppt

<B3EDB9AEC1FD5F3235C1FD2E687770>

ºÎ·ÏB

슬라이드 제목 없음

歯15-ROMPLD.PDF

11¹Ú´ö±Ô

서강대학원123호

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

10송동수.hwp

0125_ 워크샵 발표자료_완성.key

슬라이드 제목 없음

Microsoft PowerPoint - Freebairn, John_ppt

영남학17합본.hwp

Journal of Educational Innovation Research 2018, Vol. 28, No. 3, pp DOI: NCS : * A Study on

歯1.PDF

PL10

하나님의 선한 손의 도우심 이세상에서 가장 큰 축복은 하나님이 나와 함께 하시는 것입니다. 그 이 유는 하나님이 모든 축복의 근원이시기 때문입니다. 에스라서에 보면 하나님의 선한 손의 도우심이 함께 했던 사람의 이야기 가 나와 있는데 에스라 7장은 거듭해서 그 비결을

<32B1B3BDC32E687770>

°í¼®ÁÖ Ãâ·Â

현대영화연구

I&IRC5 TG_08권

歯M PDF

Output file

<31342D3034C0E5C7FDBFB52E687770>

Microsoft PowerPoint - PL_03-04.pptx

2 min 응용 말하기 01 I set my alarm for It goes off. 03 It doesn t go off. 04 I sleep in. 05 I make my bed. 06 I brush my teeth. 07 I take a shower.

<BFACBCBCC0C7BBE7C7D E687770>

Microsoft PowerPoint - hw8.ppt [호환 모드]

300 구보학보 12집. 1),,.,,, TV,,.,,,,,,..,...,....,... (recall). 2) 1) 양웅, 김충현, 김태원, 광고표현 수사법에 따른 이해와 선호 효과: 브랜드 인지도와 의미고정의 영향을 중심으로, 광고학연구 18권 2호, 2007 여름

< C6AFC1FD28C3E0B1B8292E687770>


À±½Â¿í Ãâ·Â

레이아웃 1

농심-내지

<30322D28C6AF29C0CCB1E2B4EB35362D312E687770>

저작자표시 - 비영리 - 변경금지 2.0 대한민국 이용자는아래의조건을따르는경우에한하여자유롭게 이저작물을복제, 배포, 전송, 전시, 공연및방송할수있습니다. 다음과같은조건을따라야합니다 : 저작자표시. 귀하는원저작자를표시하여야합니다. 비영리. 귀하는이저작물을영리목적으로이용할

<B9AEC8ADC4DCC5D9C3F7BFACB1B82D35C8A32833B1B3292E687770>

아니라 일본 지리지, 수로지 5, 지도 6 등을 함께 검토해야 하지만 여기서는 근대기 일본이 편찬한 조선 지리지와 부속지도만으로 연구대상을 한정하 기로 한다. Ⅱ. 1876~1905년 울릉도 독도 서술의 추이 1. 울릉도 독도 호칭의 혼란과 지도상의 불일치 일본이 조선

6자료집최종(6.8))

<B7CEC4C3B8AEC6BCC0CEB9AEC7D B3E23130BFF9292E687770>

#KM-235(110222)

_KF_Bulletin webcopy

<30352DC0CCC7F6C8F B1B3292DBFACB1B8BCD2B1B3C1A42E687770>

- 이 문서는 삼성전자의 기술 자산으로 승인자만이 사용할 수 있습니다 Part Picture Description 5. R emove the memory by pushing the fixed-tap out and Remove the WLAN Antenna. 6. INS

사용시 기본적인 주의사항 경고 : 전기 기구를 사용할 때는 다음의 기본적인 주의 사항을 반드시 유의하여야 합니다..제품을 사용하기 전에 반드시 사용법을 정독하십시오. 2.물과 가까운 곳, 욕실이나 부엌 그리고 수영장 같은 곳에서 제품을 사용하지 마십시오. 3.이 제품은

도비라

APOGEE Insight_KR_Base_3P11

6 영상기술연구 실감하지 못했을지도 모른다. 하지만 그 이외의 지역에서 3D 영화를 관람하기란 그리 쉬운 일이 아니다. 영화 <아바타> 이후, 티켓 파워에 민감한 국내 대형 극장 체인들이 2D 상영관을 3D 상영관으로 점차적으로 교체하는 추세이긴 하지만, 아직까지는 관

(JBE Vol. 21, No. 1, January 2016) (Regular Paper) 21 1, (JBE Vol. 21, No. 1, January 2016) ISSN 228

2 장수의체계 1. 10진수 2. 2진수 3. 8진수와 16진수 4. 진법변환 5. 2진정수연산과보수 6. 2진부동소수점수의표현 한국기술교육대학교전기전자통신공학부전자전공 1

(Exposure) Exposure (Exposure Assesment) EMF Unknown to mechanism Health Effect (Effect) Unknown to mechanism Behavior pattern (Micro- Environment) Re

歯kjmh2004v13n1.PDF

04-다시_고속철도61~80p

Journal of Educational Innovation Research 2019, Vol. 29, No. 1, pp DOI: (LiD) - - * Way to

DBPIA-NURIMEDIA

Microsoft PowerPoint - 06-IPAddress [호환 모드]

#중등독해1-1단원(8~35)학


<C7D1B9CEC1B7BEEEB9AEC7D03631C1FD28C3D6C1BE292E687770>

PowerPoint 프레젠테이션


2011´ëÇпø2µµ 24p_0628

Journal of Educational Innovation Research 2019, Vol. 29, No. 1, pp DOI: * Suggestions of Ways

김기남_ATDC2016_160620_[키노트].key

<C3D6C1BEBFCFB7E12D30372E3032C0DBBEF72DB1B9BEC7BFF820B3EDB9AEC1FD20C1A63139C1FD28C0FCC3BC292E687770>

본문01

대한한의학원전학회지26권4호-교정본(1125).hwp

슬라이드 1


SRC PLUS 제어기 MANUAL


<5B D B3E220C1A634B1C720C1A632C8A320B3EDB9AEC1F628C3D6C1BE292E687770>

untitled

#KM560

Chapter4.hwp

<BFA9BAD02DB0A1BBF3B1A4B0ED28C0CCBCF6B9FC2920B3BBC1F62E706466>

274 한국문화 73

DE1-SoC Board

Microsoft PowerPoint - a6.ppt [호환 모드]

... 수시연구 국가물류비산정및추이분석 Korean Macroeconomic Logistics Costs in 권혁구ㆍ서상범...

,,,.,,,, (, 2013).,.,, (,, 2011). (, 2007;, 2008), (, 2005;,, 2007).,, (,, 2010;, 2010), (2012),,,.. (, 2011:,, 2012). (2007) 26%., (,,, 2011;, 2006;

<C0FCC0DAB0E8BBEAB1E2B1B8C1B6347E36B0AD20B9AEC1A62BC1A4B4E42E687770>

Transcription:

컴퓨터구성 Lecture Series #4 Chapter 3: Data Representation Spring, 2013 컴퓨터구성 : Spring, 2013: No. 4-1

Data Types Introduction This chapter presents data types used in computers for representing diverse numbers and characters Binary Information Data Information Numbers & other binary-coded info. to be used in computation Control Information Sequence of command signals needed for data manipulation such as programmed instructions Data Types Numbers used in arithmetic computations Alphabet letters in data processing Other discrete symbols for specific purposes Grey level data, etc. 컴퓨터구성 : Spring, 2013: No. 4-2

Data Types Number System The number system of base, or radix, r is a system that uses r distinct symbols for r digits Example 1: Decimal System (Radix r = 10) 10 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Quantity of 724.5: 7 x 10 2 + 2 x 10 1 + 4 x 10 0 + 5 x 10-1 Example 2: Binary System (Radix r = 2) 2 distinct symbols: 0, 1 Quantity of 101.1: 1 x 2 2 + 0 x 2 1 + 1 x 2 0 + 1 x 2-1 컴퓨터구성 : Spring, 2013: No. 4-3

Data Types Number System Octal System (Radix r = 8) 8 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7 Hexa-Decimal System (Radix r = 16) 16 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Quantity of 4F3 4 x 16 2 + F x 16 1 + 3 x 16 0 = (1267) 10 5 3 6 5 1 0 1 0 1 1 1 1 0 1 0 1 A F 5 Octal Binary Hexa Conversion between number systems is your job!! 컴퓨터구성 : Spring, 2013: No. 4-4

Data Types Examples: Octal & Hexa Octal Number Binary-coded Octal Decimal HexadecimalBinary-coded Number hexadecimal Decimal 0 1 2 3 4 5 6 7 10 11 12 24 62 143 370 000 001 010 011 100 101 110 111 001 000 001 001 001 010 010 100 110 010 001 100 011 011 111 000 0 1 2 3 4 5 6 7 8 9 10 20 50 99 248 Code for one octal digit 0 1 2 3 4 5 6 7 8 9 A B C D E F 14 F8 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0001 0100 1111 1000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 20 248 Code for one hexadecimal digit 컴퓨터구성 : Spring, 2013: No. 4-5

Data Types Decimal Representation BCD (Binary-Coded Decimal) Only 0-9 are represented with 4 bits To make conversion to decimal numbers easy after computation 16 distinct binary combinations are unassigned (not used) Wastes 6 combinations Decimal Number Binary-coded Decimal (BCD) 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 Code for one decimal digit 10 20 50 99 248 0001 0000 0010 0000 0101 0000 1001 1001 0010 0100 1000 컴퓨터구성 : Spring, 2013: No. 4-6

Data Types Many applications require handling of not only numbers but also alphabet letters and special characters ASCII Code 8 bits (including a parity bit) Differences b/w Lower case & Upper case alphabets are 32 BCD with leading 011 are ASCII Alphanumeric Representation Char. Binary code Char. Binary code A 100 0001 0 B 100 0010 1 C 100 0011 2 D 100 0100 3 E 100 0101 4 F 100 0110 5 G 100 0111 6 H 100 1000 7 I 100 1001 8 J 100 1010 9 K 100 1011 L 100 1100 M 100 1101 SPACE N 100 1110. O 100 1111 ( P 101 0000 + Q 101 0001 $ R 101 0010 * S 101 0011 ) T 101 0100 - U 101 0101 / V 101 0110, W 101 0111 = X 101 1000 Y 101 1001 Z 101 1010 011 0000 011 0001 011 0010 011 0011 011 0100 011 0101 011 0110 011 0111 011 1000 011 1001 010 0000 010 1110 010 1000 010 1011 010 0100 010 1010 010 1001 010 1101 010 1111 010 1100 011 1101 컴퓨터구성 : Spring, 2013: No. 4-7

Complements (r-1) s Complement Used for simplifying subtraction & logical manipulations (r-1) s Complement Given a number N with n digits, its (r-1) s complement is (r n -1) - N Decimal (r = 10) 9 s complement Example: N = 3450 r n -1 = 10 4-1 = 9999 9999-3450 = 6549 Binary (r = 2) 1 s complement Example: N = 1011001 r n -1 = 2 7-1 = 1111111 1111111-1011001 = 0100110 Change 0 1 & 1 0 컴퓨터구성 : Spring, 2013: No. 4-8

Complements r s Complement r s Complement Given a number N with n digits, its r s complement is (r n -N) (r n -N) = (r n - 1) - N + 1 = (r -1) s complement + 1 Decimal (r = 10) 10 s complement Example: N = 3450 r n = 10 4 = 10000 10000-3450 = 9999-3450 + 1 = 6549 + 1 = 6550 Binary (r = 2) 2 s complement Example: N = 1011000 r n = 2 7 = 10000000 10000000-1011000 = 1111111-1011000 + 1 = 0101000 Leave all lower order 0 s before the first 1 and the first 1 unchanged and complement the remaining upper binary numbers 컴퓨터구성 : Spring, 2013: No. 4-9

Complements Notes N O T E S No differences even when radix point is present Complement of a complement results in the original Three ways to subtract depending on how negative numbers are represented (will be shown shortly) 컴퓨터구성 : Spring, 2013: No. 4-10

Complements Subtraction of Unsigned Numbers What if numbers are represented as positive numbers? Subtraction of 2 n-digit Unsigned Numbers: M - N (N 0) Find r s complement of N & add to M M + (r n - N) = M - N + r n If M N ( M - N 0 ), sum will produce an end carry r n & discard this (M - N + r n - r n ) = M - N This is the answer If M N ( M - N 0 ), sum will not produce an end carry r n M + (r n -N) = { r n -(N-M)} = r s complement of (N - M) For answer, take r s complement and regard as negative 컴퓨터구성 : Spring, 2013: No. 4-11

Complements Subtraction of Unsigned Numbers Ex 1.1: 72532-13250 = 59282 Ex 1.2: 13250-72532 = - 59282 M = 72532 M = 13250 10 s complement of N = +86750 10 s complement of N = +27468 Sum = 159282 Sum = 40718 Discard 10 5 = -100000 10 s complement of Sum = 59282 Answer = 59282 Answer = - 59282 Ex 2.1: 1010100-1000011 = 0010001 Ex 2.2: 1000011-1010100 = - 0010001 X = 1010100 Y = 1000011 2 s complement of Y = +0111101 2 s complement of X = +0101100 Sum = 10010001 Sum = 1101111 Discard 2 8 = -10000000 2 s complement of Sum = 0010001 Answer = 0010001 Answer = - 0010001 컴퓨터구성 : Spring, 2013: No. 4-12

Fixed-Point Representation Introduction Negative Values Sign Bit at the leftmost bit position 0 for positive & 1 for negative Binary Point Fixed Point At extreme left or right of the stored number in a register We assume the latter the number is integer Floating Point Will be discussed in the next section Most of computer systems use floating-point for real numbers 컴퓨터구성 : Spring, 2013: No. 4-13

Fixed-Point Representation Integer Representation Positive Integer: Sign bit and magnitude: Negative Integer: 14 = 0 0001110 Signed-magnitude: -14 = 1 0001110 Used in ordinary arithmetic; but awkward in computers Signed-1 s complement: -14 = 1 1110001 Difficult since it has two zeros (+0 (0000) & -0 (1111)) Used only in old computers for numerical arithmetic Useful in logic operations (complementation) Signed-2 s complement: -14 = 1 1110010 Primarily used in most computers as well as in my lecture 컴퓨터구성 : Spring, 2013: No. 4-14

Data Representation Summary n- bit Numbers Unsigned Numbers = Unsigned Magnitude Signed Magnitude Signed 1 s complement Signed 2 s complement Max Min Zero 2 n -1 0 0 1111 0000 0000 + (2 n-1-1) -(2 n-1-1) + 0, - 0 0 111 1 111 0 000, 1 000 + (2 n-1-1) -(2 n-1-1) + 0, -0 0 111 1 000 0 000, 1 111 + (2 n-1-1) -2 n-1 0 0 111 1 000 0 Complement 컴퓨터구성 : Spring, 2013: No. 4-15

Fixed-Point Representation Arithmetic Addition Signed-Magnitude: Same Signs Add two magnitudes and put the sign bit Different Signs Subtract smaller magnitude from larger one Put the sign of data with larger magnitude Need comparison, addition, subtraction Q: Think about the rule for adding two numbers in signed- 1 s complement format Signed-2 s Complement: Rule Add two numbers including sign bits Discard carry out of sign bit, if any +6 +13 +19 00000110 00001101 00010011-6 +13 +7 11111010 00001101 00000111 Need addition, only Negative result is in 2 s complement form +6-13 -7 00000110 11110011 11111001-6 -13-19 11111010 11110011 11101101 컴퓨터구성 : Spring, 2013: No. 4-16

Fixed-Point Representation Arithmetic Subtraction Signed-Magnitude: Rule Change the sign of subtrahend Perform Signed-Magnitude Addition Signed-2 s Complement: Rule Take 2 s complement of subtrahend Add it to minuend Discard carry out of sign bit, if any Need addition, only Negative result is in 2 s complement form Q: Think about the rule for adding two numbers in signed- 1 s complement format 컴퓨터구성 : Spring, 2013: No. 4-17

Fixed-Point Representation Overflow When two numbers of n digits with the same sign are added & the sum occupies n+1 digits, we say that an overflow occurred Overflow Flip-Flop: A flip-flop to store the (n+1) th bit of the result When is overflow? Q: Think about the case two numbers in signed-1 s complement format Addition of 2 Unsigned Numbers End carry out of MSB Addition of 2 Signed-2 s Complement Numbers End carry out of sign bit does not imply the overflow End carry out of sign bit and the carry into sign bit are different Carries: 0 1 Carries: 1 0 +70 0 1000110-70 1 0111010 +80 0 1010000-80 1 0110000 +150 1 0010110-150 0 1101010 컴퓨터구성 : Spring, 2013: No. 4-18

Fixed-Point Representation Decimal Representation Disadvantages: Wasting storage space Numeric computations & their circuits are complicated 0 375 +9 760 0 135 (0000 0011 0111 0101) BCD (1001 0111 0110 0000) BCD (0000 0001 0011 0101) BCD Advantages: No need to convert between decimals & binaries Largely used in data processing where computations are rare For BCD adder see Fig. in your textbook 컴퓨터구성 : Spring, 2013: No. 4-19

Floating-Point Representation Composition: Mantissa (m) Signed fixed-point number Exponent (e) Position of binary point Interpretation m 2 e Normalization: MSB of the mantissa is nonzero Example (in Textbook): Fraction +001001.11 0 1001110 Exponent 0 00100 m x 2 e = +(.1001110) 2 x 2 +4 컴퓨터구성 : Spring, 2013: No. 4-20

Floating-Point Representation IEEE 754 Standard Example (in Real World): Sign bit Exponent (e) 8 bits in Excess-127 Mantissa (m) 23 bits Interpretation N = (-1) s 2 e-127 (1.m) 0 1 8 9 31 Exponent Mantissa 8 bits 23 bits Sign bit 64-bit Extention Sign bit Exponent (e) 11 bits coded into Excess-1023 Mantissa (m) 52 bits Interpretation N = (-1) s 2 e-1023 (1.m) 컴퓨터구성 : Spring, 2013: No. 4-21

Error Detection Codes Binary information transmitted thru communication medium is subject to external noise. Parity Bit: Error Detection Code An extra bit to make number of 1 s in a message either even or odd Even Parity: P(even) What if the message contains all zeros? Odd Parity : P(odd) So, this is generally used. Source x y z Destination x y z Error Indication Parity Generator Parity Checker 컴퓨터구성 : Spring, 2013: No. 4-22

Homework Exercise: 3-7, 3-8, 3-15, 3-16, 3-17, 3-19, 3-26 Hamming Code: Have you ever heard about the Hamming Code? I don t think so Find a book that describes the Hamming Code and make 1 or 2 page hand-written summary as a homework. Some of you will be chosen to present the idea during the class. 컴퓨터구성 : Spring, 2013: No. 4-23