English 中文(简体)
Question on converting decimal to binary to hex [closed]
原标题:

I m a little confused here:

I m trying to reverse engineer the ASCII value 65. In the book I am reading it says:

Decimal: 65
Hex:  41
Octal: 101

But 65 in its binary representation is:

0010 0001

And 0010 in hex is 2, while 0001 is 1, which indicates that the hex value "should" be: 21.

Where did I go wrong?

最佳回答

65 dec in bin is 0100 0001.

问题回答

you have the binary wrong - it should be 0100 0001 - your bin to hex is fine

incidentally bin->oct->dec->hex is one of the things calc.exe is actually really useful for

65 in decimal is:

 0100 0001

You re off by a digit in the first nibble.





相关问题
Printing several binary data fields from Google DataStore?

I m using Google App Engine and python for a web service. Some of the models (tables) I have in my web service have several binary data fields in them, and I d like to present this data to a computer ...

Handling large ActiveRecord object set as binary data

I have an issue with manipulating large number of record objects of type ActiveRecord model(Records are extracted from a complex operation but from the same table) and I want to pass that object set ...

How to send a push notification using Erlang?

I m trying to send a push notification to APNs using Erlang. This is the code I came up with so far: -module(apnstest2). -export([connect/0]). connect() -> application:start(ssl), ssl:...

What is a suitable buffer for Python s struct module

In Python I m accessing a binary file by reading it into a string and then using struct.unpack(...). Now I want to write to that string using struct.pack_into(...), but I get the error "Cannot use ...

Storing hexadecimal values as binary in MySQL

I was thinking about how I m storing passwords in my database : appropriately salted SHA1 strings in a CHAR(40) field. However, since the character data in there is actually just a hex representation ...

View ram in DOS

Is there a way in dos (im using a dos boot disk on a linux machine) to view portions of ram? ie. some form of command to read the binary at a given address? edit: my bootable floppy doesnt have ...

热门标签