Complements Essay, Research Paper
COMPLEMENTS
INTRODUCTION:
Basic binary digits are described as UNSIGNED values. This is because if you
look at the string of bits (zeros and ones) there is no indicator whether or
not this value is positive or negative. You must use an additional symbol “+”
or “-” to indicate the sign of the number. There are some types of number
systems where you can determine the sign of number without using an addition
symbol. You can tell whether it is positive or negative by looking at the
bits. Such representations are referred as SIGNED representations because you
can determine the sign of the number from the number itself.
In signed representations you the MOST SIGNIFICANT BIT (MSB) indicates the sign
of the number. The MSB is the left most bit. If the MSB is equal to 0 then the
number is positive. If the MSB is equal to 1 then the number is negative.
e.g. 001111101 is positive
^
|
The MSB is equal to zero
e.g. 101101010 is negative
^
|
The MSB is equal to one
At this point you might ask yourself why bother with signed representations –
we perform decimal based subtractions in every day life using base ten
unsigned representations and we’re all happy and well adjusted people. The
reason why it’s important to learn about signed representations is because
when the computer tries to subtract one number Y from another number X, it
doesn’t do so in the same way that we do: i.e X – Y
Instead it uses a technique known as negating and adding:
i.e. X + (-Y) which is still equal to X – Y
CONVERSIONS (UNSIGNED BINARY TO SIGNED VALUES)
This is summary of what you must do to convert an unsigned binary value to a
complemented value.
1’s complement 2’s complement
Binary value >= 0 No change No change
Binary value < 0 Swap the bits Swap the bits and add
one to the result.
Carry out? Add it back in Ignore it
Swapping the bits means we substitue 1’s for 0’s and 0’s for 1’s.
DOING SUBTRACTIONS VIA COMPLEMENTS (ala Negate and Add)
How do we do this with the negate and add? First convert these numbers to
binary:
Base 10 Base 2 (must be signed!)
eg 4 0100
-6 -0110*
= -2
*I added one extra zero to the left hand side as an extra placeholder. When
I convert these numbers to signed values, this digit it will represent the
sign of the number. We cannot do a mathematical operation in the computer on
minus six in this form. It must be converted to a SIGNED VALUE. You can
use either a 2’s complement representation or a 1’s complement representation.
But make sure that you keep straight which one you use (don’t switch halfway
thru a computation between a 1’s and 2’s complement representation or vice
versa).
e.g.
Number to convert 1’s complement 2’s complement
(flip bits)* (flip bits + 1)*
-0110 1001 1010
Add the complemented values with to the original number above (negate and
add remember).
1’s complement way 2’s complement way
Number from above (4) 0100 0100
The complemented number 1001 1010
—- —-
Summed Result 1101 1110
Convert to this value
from a complemented
form to regular binary -0010 -0010
Convert from binary -2 -2
to decimal
Notice that there is no carry out so we con’t have to worry about addding in
the overflow or ignoring it.
*But this conversion only occurs for negative numbers. Look again at the
circles that I drew in lab, a positive number is a positive number number
matter what binary representation that you use. That means that if the
MSB is equal to a zero, when we get to the second last step, when we try
to find the equivilent unsigned binary value no conversions are necessary.
A positive unsigned digit will look the same in signed (1’s and 2’s
complement form).
Here’s another example on complements that does have an overflow bit (carry
out):
Done using 1’s complement:
Base 10 Base 2
10 1010
-3 -0011
Now here’s comes the fun stage, molding the unsigned base two numbers into
signed one’s and two’s complement representations.
Base 2 Add zero to left* Convert to 1’s complement
1010 01010 01010**
0011 00011 11100
Add the numbers 10 + (-3):
01010
+11100
——
Overflow=> 1 00110
Goes here -> +1
——
000111
Другие работы по теме:
Y2k Essay Research Paper Almost everyone has
Y2k Essay, Research Paper Almost everyone has heard the term “Y2k”, but most have no clue what it means. This research paper will explain what it means, what is to blame, and possible effects the problem could have in the future. Although the issue seems a simple, even pointless one on the surface, once examined, you can discover many separate causes and implications and how widespread this problem actually is.
Romeo An Juliet Essay Research Paper hi
Romeo An Juliet Essay, Research Paper hi i need an essay about a character in romeo and juliet that demonsrtated maturity. in a well developed multi pagraph essay and say why you think the character’s maturity was greater than the other characters in the play.
What Kind Of Problems Bring For The
New Millenium Essay, Research Paper Nobody actually knows what is going to happen when the clock strikes midnight for the year 2000. All around the world, people are concerned with what is being referred to as the Y2K computer bug. Some people are worried that the world as we know it is going to end. Others believe that everything is going to be just fine.
Oppositions Essay Research Paper Tom PennyApproachesPaper
Oppositions Essay, Research Paper Tom Penny Approaches Paper #2 The story, I Stand Here Ironing, contains binary oppositions which work together to support the structure of the text. I listed several of these oppositions in my notes, but I am only going to discuss a few that I found were connected to each other throughout the story.
Complementarity And Substitution In The Theory Of
Capital Essay, Research Paper This essay is an explanation and importance of complementarity and substitution in the theory of capital. Complementarity can be usually seen in goods with ?sympathetic shifts in demand.? It is also important to realize the narrowness of the traditional treatment of complementarity.
Have Some Pi Essay Research Paper Have
Have Some Pi Essay, Research Paper Have Some Pi Way back over 3,000 years ago before the before the advent of modern miracles like sliced bread and aerosol cans are Pi’s roots available for finding. The Egyptians after countless years of losing in battle due to having square wheels on their chariots decided to solve this wheel thingy once and for all so after many committee meeting and much arguing Pi was decided to be 3 1/7 and a certain bored scribe known as Ahmes recorded it in 1650 B.C.
Oh Really Essay Research Paper Oh Reallyyou
Oh Really? Essay, Research Paper Oh Really, you think i am a lark, the dogs they run and bark, but when i say to them, shut up shut up shut up, you say to be nice to them,
Binary Thinking Essay Research Paper Binary thinking
Binary Thinking Essay, Research Paper Binary thinking related to Salem Witch Trials The Puritans were European settlers that established home in Salem Village in the 1630s. They believed that they were a dominant group because of their practices. They saw their religion as superior to any other religion.
The Binary Number System Essay Research Paper
The binary number system is a system in which numbers are represented as linear combinations of the powers of two. A binary number is a number written in base two. This means that each position in a numeral represents a particular power of two. In the more common decimal system, powers of ten are used. A positive integer is represented in base two by a line of zero?s and one?s.The binary number system is important because of its application and value in computers.
Binary Systems Essay Research Paper Binary systems
Binary Systems Essay, Research Paper Binary systems are a major factor of everyday live. As years pass the use of a binary system has changed dramatically. Throughout this essay I will explain what binary systems are, how they were used in the past, and how they are being used today. A binary system is defined as a numbering system with a base (radix) of 2, unlike the number system which has bases of 10.
Binary Reasoning Essay Research Paper Binary reasoning
Binary Reasoning Essay, Research Paper Binary reasoning limits our knowledge for it oversimplifies the subject being studied. Computers operate in binary mode, that is they only can understand a 1 or a 0, and this fact is what makes artificial intelligence so hard to achieve. The fact that humans can work outside of simple duality is what distinguishes us from other animals and machines.
How To Hack Gameshark Essay Research Paper
How to Hack Gameshark CodesThis “How To” was created by Jerry Bond, one of the gameshark code creators of this site. There may be more coming soon.1. Choosing the kind of hacker to be:There are three kinds of hackers, those who type in anything and hope for agood code (FreeStyle Hackers), those who modify pre-made codes (PlanedHackers) and those who do both (ComboHackers).
Shane Essay Research Paper Sometimes I need
Shane Essay, Research Paper Sometimes, I need you more than I need air And sometimes I miss you more than I will forever, never forget the times that we have shaared. The are priceless
Poem Belong Essay Research Paper Where I
Poem: Belong Essay, Research Paper Where I belong I am weak, I am strong I will fit where I belong don’t know where it is for now but it will come, if I allow tomorrow, I start a brand new day
Scripts Essay Research Paper 30
Scripts Essay, Research Paper 3.0 Variables Scripts may contain variables. Variable names must begin with a letter or an underscore (’_'), and may contain any sequence of upper- or lower-case letters, digits, and underscores. You cannot use a reserved word as a variable name. For more information, see the list of reserved words at the end of this document.
Y2k Bug Essay Research Paper One of
Y2k Bug Essay, Research Paper One of my biggest concerns about the turning of the new millennium is one that s been getting a lot of press as of late. That is the Year 2000 (Y2k) Bug. The Y2k bug has to do with how a particular computer will deal with the year 2000. No Macintosh product will have any problems with the so called “bug” because when the Mac was developed, they used four digits to represent the year, allowing 2000 to be read as “2000″ and not just “00.” As a matter of fact, the Macintosh can read up to the year 29,948 (but don t worry, they re already hard at work on the Y30k problem.) The problem will occur, however, in non-Macintosh based computers (IBM, Compaq, Gateway, etc.) They will read 2000 as “00″ and will interpret that as 1900, making the computer think it just jumped back a century.
Y2k 5 Essay Research Paper Using a
Y2k 5 Essay, Research Paper *Using a 100-year logic window The logic window approach allows the system to determine the century or decade of a given year by comparing the value of the two digit field against an application window. One version of this technique allows for a sliding window, in which one changes the boundaries of the window and the user is notified when the window is about to advance.
Pyrotechnics Essay Research Paper PYROTECHNICSPyrotechnics special effects
Pyrotechnics Essay, Research Paper PYROTECHNICS Pyrotechnics special effects are widely used in motion picture production to create all types of effects involving explosions, fires, light, smoke and sound concussions. The types of pyrotechnics materials used include flash powder, flash paper, gun cotton, black powder (gunpowder), smokeless powder, detonator explosives, and many more.
Bacteria Essay Research Paper True cells
Bacteria Essay, Research Paper True cells with a wall, membrane, cytoplasm, ribosomes and DNA. No distinct nucleus DNA not incorporated in chromosomes but comprising a single, circular strand Bacteria
Poem She Sat Essay Research Paper She
Poem: She Sat Essay, Research Paper She sat… helpless in her room praying to whatever god there may be to let her call to him. could god ignore such a painful cry?
Definig Ones Life Essay Research Paper Defining
Definig Ones Life Essay, Research Paper Defining Ones Life Defining oneself can be a difficult thing to do. There are many reasons why defining oneself may sometimes be positive and sometimes been negative. It is sometimes good no matter who you wore to define yourself, but sometimes it is not. In this essay I intend to look at both reasons why defining oneself is good and bad.
Bush Vs Mccain Essay Research Paper As
Bush Vs. Mccain Essay, Research Paper As expected, Governor George W. Bush of Texas has won the Republican Party nomination for the presidential election in November. All along, Bush was the predicted winner for the GOP, but Senator John McCain of Arizona gave the Governor a run for his money. Although Bush was able to defeat him, John McCain was, and still is, the best candidate for the presidency.
Ode To Boys Essay Research Paper We
Ode To Boys Essay, Research Paper We like them But do they like us The ones we do never fuss They don’t stop in And we wonder why We stress, we bitch We sometimes cry
Nostoc Information Essay Research Paper Scientific name
Nostoc Information Essay, Research Paper Scientific name – Kingdom- Monera, Phylum- Cyanobacteria, Class- NA, Order- nostocaler, Family- Nostocaceae, Genus- Nostoc, Species- caeruleumDescription- Nostoc is a one celled autotrophic organism that performs photosynthesis with out chloroplasts.
Dare Essay Essay Research Paper What DARE
Dare Essay Essay, Research Paper What D.A.R.E Means To Me Dare has prepared me to say no to drugs in eight different ways. If anyone asks me to do drugs I will know what to do, such as- just ignoring the person or just
The Internet Essay Research Paper The Internet
The Internet Essay, Research Paper The Internet: How it Works and How it Effects the World Many people do not understand what the Internet is the power that it has over the world. The Internet is an extraordinary learning and entertainment tool that, when used properly, can significantly enhance a user’s ability to gather information.