Docsity

Computer Architecture and Organization - Data Representation, Study notes of Computer Architecture and Organization

Partial preview of the text

Download Computer Architecture and Organization - Data Representation and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Unit-2: Data Representation

Recap

Session Objectives & Teaching Learning Material

Session Plan  Data Presentations  Unsigned  Signed Magnitude  (^) 1’s Complement  2’s Complement

Assignment

References OutLine

Session Plan Time (in min) Content Learning Aid and Methodology Faculty Approach Typical Student Activity Skill and Competency Developed

Re-Cap

Quiz Presentation Questions Organizes Answers Identifies Knowledge Evaluation

Data

representations

Exlpains Presentations Observes Knowledge

Un Signed

Explains Presentation Listens Application

05 Signed Explains

Presentatio n

Listens Analytical

10 1’s Complement Explains

Presentatio n

Listens Analytical

10 2’s Complement Explains

Presentatio n

Listens Analytical

Conclusion and Summary Summary Facilitates Listens Participates Comprehensio n

Informatio n Instructio ns Data Numerical Non Numeric Fixed Point Floating Point Binary Octal Decimal Hexa Decimal

UNSIGNED

the standard binary encoding already given only positive values range: 0 to 2 n - 1 for n bits example: 4 bits, values 0 to 15 n=4, 2^4 -1 is 15

SIGN MAGNITUDE

A human readable way of getting both positive and negative integers. The hardware that does arithmetic on sign magnitude integers is not fast, and it is more complex than the hardware that does arithmetic on 1's comp. and 2's comp. integers. Use 1 bit of integer to represent the sign of the integer let sign bit of 0 be positive, 1 be negative. The rest of the integer is a magnitude, using same encoding as unsigned integers example: 4 bits 0101 is 5 1101 is - To get the additive inverse of a number, just flip (not, invert, complement, negate) the sign bit.

ONE's COMPLEMENT

historically important, and we use this representation to get 2's complement integers. Now, nobody builds machines that are based on 1's comp. integers. In the past, early computers built by Semour Cray (while at CDC) were based on 1's comp. integers. positive integers use the same representation as unsigned. 00000 is 0 00111 is 7, etc. negation (finding an additive inverse) is done by taking a bit wise complement of the positive representation.

COMPLEMENT. INVERT. NOT. FLIP. NEGATE.

a logical operation done on a single bit the complement of 1 is 0. the complement of 0 is 1. EXAMPLES: 11100 This must be a negative number. To find out which, find the additive inverse! 00011 is +3 by sight, so 11100 must be - Things to notice:

  1. any negative number will have a 1 in the MSB.
  2. there are 2 representations for 0, 00000 and 11111.

how to get an integer in 2's comp. representation: positive values are the same as for sign/mag and 1's comp. They will have a 0 in the MSB (but it is NOT a sign bit!) positive: just write down the value as before negative: To get the additive inverse of a 2's comp integer,

  1. take the 1's comp.
  2. add 1

EXAMPLE:

What decimal value does the two's complement 110011 represent? It must be a negative number, since the most significant bit is a 1.Therefore, find the additive inverse: Therefore, it's additive inverse (110011) must be -13.

Data Representations Unsigned Signed Magnitude 1’s Complement 2’s Complement Summary

Submit a Case Study report on “ Calculator

Arithmetic Using Binary Coded Decimal”

◦ (^) Ref: Vincent .P. Heuring, Harry F. Jordan “ Computer System design and Architecture” Pearson, 2 nd Edition, 2003

Assignment