0 Up votes0 Down votes

33 views3 pagesT1-2-SignedConversions

Jan 27, 2014

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

T1-2-SignedConversions

Attribution Non-Commercial (BY-NC)

33 views

T1-2-SignedConversions

Attribution Non-Commercial (BY-NC)

- Hexadecimal Numbers
- Activity 3 Asm 2
- rr310504-theory-of-computation
- Chapter Two: Finite Automata
- operations on bits
- c Hardsoft
- ECE 551 Homework #1
- RouteSummaryNotesfromICND2
- Two Phase Flow Void Fraction Measurement Using Image Processing by manish pujara
- fox & c
- Unit 1
- Lec 3 Number System and Data Representation
- COE221 Lect2 Numbersystems 2s
- Chapter One
- 473_CSC 303A
- Chapter 1 Digital Electronics Le Dung
- EMV v4.3 Book 3 Application Specification 20120607062110791
- L01.Hexadecimal+Computation
- Test Series
- Cheat Digimon World 2

You are on page 1of 3

Page 1 of 3

Signed integers are formatted such that the leftmost bit is a sign bit (a 1 representing a negative number, and a 0 representing a positive number). The most important thing to know when working with signed numbers is how large the number is (how many bits is it). For example: 110110112: is this a positive or negative number? If the above number is an 8 bit number, then it is negative. But, if the number above is a 16 bit number (without the preceding 0s shown) then the number is a positive number. To convert signed binary numbers to/from octal or hexadecimal numbers, you use the same procedure outlined previously, and as shown below. To convert between decimal and binary, octal, or hexadecimal, the procedure is a little more complex. Using a conversion between binary and decimal as an intermediary step between octal-decimal and hexadecimal-decimal conversions, simplifies the process and will be show below.

There are two important points to keep in mind when converting Signed Binary to Hex or Octal: #1. If the binary number is a signed number, then so is the octal or hex number #2. Hex and octal numbers are just short-hand notations for binary

Solution: As done with unsigned numbers, group the binary digits into groups of 3 and replace with the appropriate octal character (starting at the binary (decimal) point). 1 100 100 110 111 101 = 1446758

Solution: As done with unsigned numbers, group the binary digits into groups of 4 and replace with the appropriate hex character (starting at the binary (decimal) point). 1100 1001 1011 1101 = C9BDx

Solution: As done with unsigned numbers, replace with the octal characters with the appropriate group the binary digits. Then fill in any preceding 0s. You do not always have to fill in any preceding 0s, but without them (or knowing about them) you may not be able to tell if the number is positive or negative 13728 = 1 011 111 010 = 0000000010111110102 which is a positive number

Solution: As done with unsigned numbers, replace with the hex characters with the appropriate group the binary digits. Then fill in any preceding 0s. You do not always have to fill in any preceding 0s, but without them (or knowing about them) you may not be able to tell if the number is positive or negative 3FBDx = 0011 1111 1011 1101 = 00111111101111012 which is a positive number

Convert an 8 Bit Signed Binary Number to Decimal Convert Signed Binary 101111012 to Decimal

Solution: If the sign bit is a 0, the conversion is the same as an unsigned integer. If the sign is a 1, we must first find the magnitude of the number. To do so, the number must be negated by executing the two's complement operation. Note that the sign bit is included in the operations performed on the number:

1 0111101 Original Value (sign bit separated for clarification)

0 1000010 +1 0 1000011 One's Complement Add 1 Result.

Page 2 of 3

010000112 = 6710 So, because the original number was a negative number, we have to remember that as a part of the result. Therefore, 101111012 = -6710. Note: A simple way to perform the 2's complement operation is to scan the bits from right to left, keeping all of the digits up to and including the first logical 1. Then, change each bit.

1 0111101 1 0 100001 0 1000011 Original Value Keep the first 1 that is found Toggle the remaining bits Result.

Solution: If the sign bit is a 0, the conversion is the same as an unsigned integer. If the sign bit is a 1, the number is first converted as an unsigned integer, and then a 2's complement operation is performed on the result in order to generate a negative answer. -102 Original Value in decimal, so we will convert +102 to binary using the methods we have already discussed

011001102 Binary Equivalent of +102. A preceding 0 had to be added to make it an 8 bit number. We must now take the two's compliment of this number because the original number (-102) was negative. 100110102 Two's Complement, and final answer

To convert positive numbers between number systems, we would perform the same procedures already outlined in the unsigned conversion procedures. To convert negative numbers between binary, octal, or hex to/from decimal is another story. Above, you saw that converting positive or negative numbers from binary to either hex or octal was the same procedure as converting positive numbers. But, converting negative numbers from decimal to binary, or binary to decimal, you must first find the magnitude of the number (convert it to a positive number), and then convert it to the target number system. keeping in mind that the original number is negative, and make the appropriate changes at the end. Because conversions between binary and hex or octal are so easy, I recommend a two step process when converting negative numbers to/from

Page 3 of 3

decimal and octal or hex. I convert the original negative number to binary first, and then convert it to the target number system. For example:

Solution: Convert 1446758 to binary first: 1446758 = 1 100 100 110 111 1012 This number is negative, because the MSb (Most Significant bit) is 1. We must now take the two's compliment to find the magnitude of the number: 1100100110111101 original 0011011001000010 1s compliment +1 0011011001000011 2s compliment We can now convert to decimal: decimal = 0*215 + 0*214 + 1*213 + 1*212 + 0*211 + 1*210 + 1*29 + 0*28 + 0*27 + 1*26 + 0*25 + 0*24 + 0*23 + 0*22 + 1*21 + 1*20 decimal = 0 + 0 + 8192 + 4096 + 0 + 1024 + 512 + 0 + 0 + 64 + 0 + 0 + 0 + 0 + 2 + 1 = 13891 But, the original number was negative, so don't forget the negative sign decimal = -1389110

Solution: Convert C9BDx to binary first: C9BDx = 1100 1001 1011 11012 This number is negative, because the MSb (Most Significant bit) is 1. We must now take the two's compliment to find the magnitude of the number: You will note that this is the same number as above, so our results are same (Wow! that doesn't happen very often!) 1100100110111101 original 0011011001000010 1s compliment +1 0011011001000011 2s compliment We can now convert to decimal: decimal = 0*215 + 0*214 + 1*213 + 1*212 + 0*211 + 1*210 + 1*29 + 0*28 + 0*27 + 1*26 + 0*25 + 0*24 + 0*23 + 0*22 + 1*21 + 1*20 decimal = 0 + 0 + 8192 + 4096 + 0 + 1024 + 512 + 0 + 0 + 64 + 0 + 0 + 0 + 0 + 2 + 1 = 13891 But, the original number was negative, so don't forget the negative sign decimal = -1389110 The procedure to convert negative decimal numbers to binary, octal, or hex is the same, but in reverse. #1. Remove the negative sign (but don't forget about it) #2. Convert the positive decimal number to binary #3. Take the two's compliment of the binary number (to change it to negative #4. Convert the negative binary number to octal or hex.

- Hexadecimal NumbersUploaded bySmilingSana
- Activity 3 Asm 2Uploaded byBea Gorospe
- rr310504-theory-of-computationUploaded bySRINIVASA RAO GANTA
- Chapter Two: Finite AutomataUploaded bysonaliraiagarwal1
- operations on bitsUploaded byPrabhjot Kaur
- c HardsoftUploaded byCarlos Mendoza
- ECE 551 Homework #1Uploaded byKeri Sawyer
- RouteSummaryNotesfromICND2Uploaded byDhana Prakash
- Two Phase Flow Void Fraction Measurement Using Image Processing by manish pujaraUploaded byPujara Manish
- fox & cUploaded byAnurag Goel
- Unit 1Uploaded byRana Akash Singh
- Lec 3 Number System and Data RepresentationUploaded byHydie Cruz
- COE221 Lect2 Numbersystems 2sUploaded byAsad Ur Rehman
- Chapter OneUploaded by_84mhm
- 473_CSC 303AUploaded bydnlkaba
- Chapter 1 Digital Electronics Le DungUploaded byluuvanhoan1993
- EMV v4.3 Book 3 Application Specification 20120607062110791Uploaded byGregorio Gazca
- L01.Hexadecimal+ComputationUploaded byAnonymous E9ySJLqs
- Test SeriesUploaded bymailsend
- Cheat Digimon World 2Uploaded bySintiyaCinta
- Moore and Mealy MachinesUploaded byThahsin Thahir
- Eu 30059Uploaded byJason Fitch
- vahid_digitaldesign_ch01Uploaded byMauricio Alves
- Algotirmo de Quine MccluskyUploaded byAbraham Conde
- bao1qwwwUploaded bytayan1
- Intro Lec1Uploaded byThong Nguyen Thanh
- Master FFBUploaded bypartha maji
- Cprogram.txtUploaded bybhole nath
- permissions-wicherski.pdfUploaded byPawan Kumar
- Proguide DraftUploaded byPham Thai Thinh

- Ece Engr 501 Chapter 02Uploaded byshahanisubhash
- aLec03Uploaded byshahanisubhash
- syllabusUploaded byshahanisubhash
- BIOM CHATUploaded byshahanisubhash
- dsd lab 7Uploaded byshahanisubhash
- Error ControlUploaded byshahanisubhash
- UPADSUploaded byshahanisubhash
- ECE 251 HwUploaded byshahanisubhash
- Project ReportUploaded byshahanisubhash
- lab5dsdquesUploaded byshahanisubhash
- Solutions Manual to Computer Architecture Pipelined and Parallel Processor DesignUploaded byKapil Malhotra
- Change of VariableUploaded byshahanisubhash
- Passport Form - PPFormUploaded byDevilschosen
- Lecture 5Uploaded byshahanisubhash
- Random VariablesUploaded byJamili Chewe
- Ics151 Fq05 FinalUploaded byshahanisubhash
- Laws and Theorems of Boolean AlgebraUploaded byJeff Pratt
- Lecture 15Uploaded byshahanisubhash
- shahani_anmol.pdfUploaded byshahanisubhash
- Presentation.pdfUploaded byshahanisubhash
- Air Terminal ControlUploaded byshahanisubhash
- Signature Verification FormUploaded byAmey Shelke

- Formal Language a Practical Introduction by Adam Brooks WebberUploaded byRaghav Agrawal
- Lesson 5Uploaded byTrần Ngọc Lâm
- Swidlec Lecture 01Uploaded byzebra_finch
- EC381_lecture2.pdfUploaded byCorazon corazon
- Time ComplexityUploaded byAvi Singh
- MELJUN CORTES - Logic Design & Switching (Digital Logic Design)Uploaded byMELJUN CORTES, MBA,MPA
- Array MultiplierUploaded byVarsha Lalapura
- RGPV Diploma Syllabus Computer Science and Engineering 5th SemUploaded byRkRishi Choudhary
- intcodingFPFLPUploaded byAynura Mahmudova
- Evaluative LanguageUploaded byCapuchino HuiNing
- float.pdfUploaded bySrinivas Cheruku
- Lambda Calculus CLCUploaded byDan Mark Pidor Bagsican
- Computer ArithmaticUploaded bymanishbhardwaj8131
- num_ans.pdfUploaded bySuppenguin
- nfaUploaded bySomnath Nandy
- Discrete Maths 2002 Lecture 04 3 Slides PpUploaded byapi-26021617
- Programming for beginnerUploaded byAbenCintata
- BINARY AND HEXADECIMAL NUMBER SYSTEMUploaded bykaran007_m
- FSAUploaded bysumesh215
- Week 3 Karnaugh Maps.pdfUploaded byMuzaFar
- 7th semUploaded byArul Prakash
- Solutions chapter 6 AutomataUploaded bySwati Patel
- hw1_ahambasanUploaded byAlex Hambasan
- SignedRepresentationUploaded byAnshul Vyas
- Fixed Point Representation Integer RepresentationUploaded byoureducation.in
- UT Dallas Syllabus for cs4384.001.10s taught by Dung Huynh (huynh)Uploaded byUT Dallas Provost's Technology Group
- HW3Sols.pdfUploaded byTP PROXY
- Chapter IV Computer Arithmetic (1)Uploaded byjohnsamvlb
- ENGG1811: Lab 02 Work BookUploaded bychris48182
- Mt1 SolutionsUploaded byEssam Radwan

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.