6 views

Uploaded by Johannes Paulo M. Cardona

Attribution Non-Commercial (BY-NC)

- Coping With Fixed Point-Bry
- Net Analysis Manual
- 37 Computer Science Unit-02
- 214423888-Module-5-Digital-Instrument.pdf
- CHAPTER 1 - Number Systems, Codes and Applications
- MC9211 CO unit 1
- Experiment Binary and Decimal Numbers
- Fixed Points Yu a Shashkin
- Internal Representation
- Ch1 Presentation
- Cheat Digimon World 2
- Bcd Adder Verilog
- Booth Tutorial
- Cs302 100% Correct Mcqs 1
- L01-NumberSystems
- Itc Lab 1 Word Flier(2)
- Logic Circuit Notes 1
- Chapter 8 Digital Electronics
- Digital Signal Processing
- Comp Arith Notes

You are on page 1of 17

So, we have

Why does it work? Given a value in a certain number system, we want to convert it to a , i.e., we need to find all 's in the expression:

Dividing this by

, we get

, the subsequent is

Multiplying this by

, we get

Note: This method is mostly applicable to conversion of values given in decimal (base 10) system to other systems (base r=2, 8, 16, etc.), simply because we are trained to multiply and divide only in decimal system. In theorey one could use this method to convert a value given in any number system, but one has to know how to multiply and divide in that particular system. More Examples:

Next: Two's Complement Representation Up: arithmetic_html Previous: Number Systems Ruye Wang 2003-10-24

o

o

Note:

significant bit (MSB) and the lowest bit (right-most) the least significant bit (LSB). Complement representation is always determined by the number of digits or bits in the representation. Given n bits, is treated as 0 since the 1 in the (n+1)th bit cannot be represented (e.g., , ). Complement of zero: (e.g., Complement of complement: , ).

Sign extension: any number of 0's can be added in front of a number without changing its value. Similarly, any number of 1's can be added in front of the 2's complement representation, without changing its value. Decimal sign extension:

Purpose of complement representation: The 2's complement representation is used to deal with negative numbers and subtractions, because complement is compatible with negation: , , as shown above.

The 1 in the 4th digit is automatically dropped as only Example 2: Carry out binary subtraction in hardware for representing a number. , with

Note that the 7th bit is automatically dropped as only bits are available in hardware. This example shows subtraction can be carried out as an addition of 2's complement of the second number. The question is, how can the 2's complement be easily found?

Three ways to find 2's complement: Given an n-bit binary number found by one of the following equivalent ways: , its 2's complement can be

1. Carry out the subtraction in the definition 2. First find bit-wise complement ( , complement), then add 1 to the LSB Example: ;

) of

; (called 1's

Note that

3. Leave all least significant 0's and the first 1 unchanged, then bit-wise complement the remaining bits. Example:

Note that the least significant three bits 100 are unchanged. Observation on the MSB of 2's complement Assume bits available:

If and

If

, then

i.e., both

and

are represented by

with MSB=1.

If

o

The MSB of

is 1:

Conclusion:

If If

is always 0;

is always 1;

Example:

Next: Fixed-Point Representation Up: arithmetic_html Previous: Number System Conversion Ruye Wang 2003-10-24

Next: Signed-Complement Representation for Fractions Up: arithmetic_html Previous: Two's Complement Representation

Fixed-Point Representation

Signed 2's complement

A fixed point number (an integer) defined as:

If

The MSB can therefore be used as the sign bit. Both cases can be represented by the following:

Note:

Assume there are a fixed number of n bits available in hardware for representing a given value. When , in the expressions above corresponds to a 1 in the (n+1)th bit, which is always ignored in n-bit representation as the (n+1)th bit does not exist. The remaining is in binary form. When , is the definition of 2's complement of .

In this example, the range of values representable by 3-bit signed 2's complement is from 0 to for positive values and from values. In general, we note:

to -1 for negative

When

When

i.e. . The MSB is thus used as the sign-bit to indicate whether the number is positive or negative. The Overall range for Signed-Complement representation is: ;

Any value beyond this range cannot be properly represented as the MSB no longer correctly indicates whether

or

Signed-2's complement representation simplifies the operations when dealing with negative operands and subtractions.

values are represented by signed 2's complement, MSB=1 for to -1), MSB=0 for the values on the

Find value represented in signed-2's complement To find the value of a given number complement format, check the MSB or the sign bit

in signed 2's :

If

If

Example (n=6):

Next: Signed-Complement Representation for Fractions Up: arithmetic_html Previous: Two's Complement Representation Ruye Wang 2003-10-24

Assuming there are n bits available, and a fraction can be represented by assuming the decimal point to be between the two most significant bits and . And the signed-complement representation of a fraction is the same as that of the integers:

If

, but the

Given values is

- Coping With Fixed Point-BryUploaded byRajesh Kumar
- Net Analysis ManualUploaded bybdrgboise
- 37 Computer Science Unit-02Uploaded bylatha
- 214423888-Module-5-Digital-Instrument.pdfUploaded byadityarana531
- CHAPTER 1 - Number Systems, Codes and ApplicationsUploaded byVince Dela Cruz
- MC9211 CO unit 1Uploaded bysanthosh
- Experiment Binary and Decimal NumbersUploaded byH Aries Oña
- Fixed Points Yu a ShashkinUploaded bysohrab
- Internal RepresentationUploaded bywasif28
- Ch1 PresentationUploaded bytesting_34567
- Cheat Digimon World 2Uploaded bySintiyaCinta
- Bcd Adder VerilogUploaded byAnonymous eWMnRr70q
- Booth TutorialUploaded byakbisoi1
- Cs302 100% Correct Mcqs 1Uploaded bykhanlala1
- L01-NumberSystemsUploaded by666667
- Itc Lab 1 Word Flier(2)Uploaded byInam Shah
- Logic Circuit Notes 1Uploaded bystephen_562001
- Chapter 8 Digital ElectronicsUploaded bySai Printers
- Digital Signal ProcessingUploaded byJoshua Duffy
- Comp Arith NotesUploaded bydannmartins9
- 12431_jumps and FlagUploaded byAkanksha Chauhan
- Implementation of the LMS Algorithm for Noise Cancellation on Speech Using the ARM LPC2378 ProcessorUploaded byDominic
- ARITH20_CarloughUploaded bypreethisudha
- F22-6517 Introduction to IBM Data Processing Systems Jun60Uploaded bykgrhoads
- Digital ElectronicsUploaded bycnpithadia
- Enabling GreenerUploaded bynijos3294
- ppt(2)Uploaded bymithravvnr
- V02S120101Uploaded bykudd
- Launchpad Programmer's ReferenceUploaded byVicente Rubino
- Plan if i Care Way AheadUploaded byAvram Paula-roxana

- Excel ShortcutsUploaded byJohannes Paulo M. Cardona
- 1745Uploaded byJohannes Paulo M. Cardona
- Lukas PIC TutorialUploaded byg@vo
- Literature ReviewUploaded byJohannes Paulo M. Cardona
- AT89C2051 DatasheetUploaded byyampire
- 3 – D filmUploaded byJohannes Paulo M. Cardona
- Lecture 4Uploaded byJohannes Paulo M. Cardona
- StrengthsUploaded byJohannes Paulo M. Cardona

- Hadamard Matrices and WeavingUploaded byEduardo Perez Careta
- Trimble Elta Software User Guide Ver0200Uploaded byRR886
- Chapter 4 - Complex Numbers.pdfUploaded byRayan
- pre-algebra expectations 2013-2014Uploaded byapi-234516738
- Modular ArithmeticUploaded bySingh Sudip
- v14_n4Uploaded bysovannvireak
- Solved C ProgramsUploaded byskishor
- AbstractUploaded bydwi wahyuningtyas
- mwrUploaded byPratik D Upadhyay
- USA-AIME-2004Uploaded byVarun Kaushik
- UNIT-1-DAAUploaded byPiyush Srivastava
- math 20-1 sequences and series unit planUploaded byapi-257672273
- NCERT Solutions Class 12 Math Chapter 3 MatricesUploaded byVidyakul
- Dsp Lab -15ecl57 Part_iUploaded byvsuresha
- ConvolutionUploaded byshirinmo
- LQG_MPC_Notes.pdfUploaded byRaja Balan
- Inference SummaryUploaded byAndy Tran
- Optimum Design of a Condenser.pdfUploaded byaminiaan
- 1M_MathsUploaded byDaniel Worrall
- doc 8991 Forecasting EnUploaded byMohamed Abodabash
- allChap6.pdfUploaded bymohit
- Dynamics of StructuresUploaded byivan
- Machine Epsilon in MATLABUploaded bysonny
- ELEC6_1Uploaded byJos1
- 09 LCD Slide Handout 2Uploaded byMichael B. Silva
- Homework #5, Sec 11.3Uploaded byMasaya Sato
- text set annotated bibliographyUploaded byapi-342416616
- DSP Principles Algorithms and Applications Third EditionUploaded byHarish Gunasekaran
- Algebra Part3Uploaded byChang Xin Lim
- CFA lvl II Quantitative Methods Study notesUploaded byGerardo San Martin