Computer problems,Computer help
*AX SOFT>>>Programming & Design

Arrange the following in descending order?


all are hexadecimal representations of 16bit signed integers (2's complement system):

3EEE 8000 DEED 7012 FFFE 0644 FF00

I know that 8000 is the most negative since it is 1000000000000000 in binary and the 1 indicates it is the largest negative number, but I don't understand how to convert a 2's complement hex number to the proper negative or positive decimal number to tell which order these numbers go in...can anyone explain?

each letter represents 4 bits. So any number that begins with 8-F is negative

You can convert the numbers like so

hex binary
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111

To convert the number to binary each hex digit represents 4 bits.

so

DEED = 1101:1110:1110:1101

to get the magnitude convert this number to its positive representation. flip the bits and add 1

1101:1110:1110:1101

0010:0001:0001:0010
+ 0000:0000:0000:0001
------------------------------------
0010:0001:0001:0011

Converting back to Hex using the binary representation for each number
: 2: 1: 1: 2

so DEED = - 2112

hope this helps.

-- edit --
You do not need to convert to decimal to answer this question.

The simple way to convert hex to decimal is to multipy each digit by 16^n where n represents the position of the hexadecimal digit.

so ABCD = A(10) *16^3 + B(11) * 16^2 + C(13) * 16^1 + D(14) * 16^0

or simply (10 * 16^3) + (11 * 16^2) + (13 * 16^1) + (14 * 16^0) =40960 + 2816 +192 + 14
= 43982

what????

Hi there,

If you have Windows you can do this on the Calculator that comes with it.

Open the calculator and click on View, then select Scientific.

Tick the Hex selection, enter your hex code, then tick Bin (Binary). The binary conversion of the hex code will appear as the result display.

Good luck with it!

Directly converting a hexadecimal number to a 2's complement binary number can be difficult... So first convert the hexadecimal number to binary and then to decimal...and after that you can arrange it in a descending order
Use the following table and convert the hexa decimal numbers to binary
0=0 0 0 0
1=0 0 0 1
2=0 0 1 0
3=0 0 1 1
4=0 1 0 0
5=0 1 0 1
6=0 1 1 0
7=0 1 1 1
8=1 0 0 0
9=1 0 0 1
A=1 0 1 0
B=1 0 1 1
C=1 1 0 0
D=1 1 0 1
E=1 1 1 0
F=1 1 1 1
Replace each Hexa digit by the binary in the table...

3EEE=(binary of 3) (binary of E)(binary of E) (binary of E)
...... ... (0 0 1 1)...(1 1 1 0)...(1 1 1 0)...(1 1 1 0 )
3EEE=0011111011101110
convertint this to decimal is use of normal procedure....
starting from the least significant bit
0 x 2^0 + 1x 2 ^1+....+0 x 2^15 = 16110

If the most significant bit (left most bit in a binary number of 16 bits) is 1 then ignore that bit and
subtract 1 from the result... flip the bits in the result from subtraction and convert it to decimal using the method mentioned above.... result is a positive number....but because you have got a 1 in the most significant bit position it becomes a negative number

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Can <tr> rows be styled or do you have to style seperate <td> cells?

    Yes, table rows, can be styled, but you can;t just specify any type of style. Then again, this is true for all HTML elements. I know you can specify a background for a table row, but not a borde...

  • Autorun function?

    All you need to do is put an autorun.inf file in the root. Check the source. Note that autorun is a request, not a demand. Users may have their computer set up to disregard autoruns.

    ...
  • Here in Javascript version. Anyone can change it to vbscript?

    vbscript isn't really a good choice as it is server side while javascript is client side. You would need a big rework of this and turn it into a form. So you'd end up with a clunky for...

  • How do I make fractions on the?

    Go to insert, object (make sure create new) tab is clicked, then scroll down to microsoft equation. if it's not there, then u might have to install that part off of the cd

    ...
  • Computers....?

    go to start then contol panel. select internet options , now a second screen will appear look all the way down to the bottom one and select delete all "web Browseing history pass-word etc.&quo...

  • Images on my website can only be viewed in Safari.....why!?

    I'll assume that you actually did upload the image file as well as the HTML, since you're following the tutorial. Check the HTML code for errors. Does your image tag look like this? .....

  • Can someone please tell me what a background url is? thanks a ton! 8)?

    Background URL refers to CSS styling, either inline, embedded or external css file, to pull an image to be used as a background within the container used. For a complete page bg image and using th...

  • How is it possible to make all the letters except for the first in every word be small caps in CSS?

    Um, I'm not sure what small caps is, did a quick google and hope this works. Say the class for your text is .texxxt .texxxt {font-variant:small-caps;} .texxxt:first-letter {font-variant...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster