Decimal-Hex-Binary coverter

1

1Adata

is there simple standalone freeware utility to convert decimal-hex-binary
values?

0 = 0xFFFF = 1111 1111 1111 1111
1 = 0xFFFE = 1111 1111 1111 1110
2 = 0xFFFC = 1111 1111 1111 1100
3 = 0xFFF8 = 1111 1111 1111 1000
....
can no find one that preserve results exactly in this format.
 
1

1Adata

Stan Weiss said:
decimal-hex-binary can be done using the calculator that comes with
Windows.
I am on a W2k machine. In view change to scientific mode you can that
select hex, dec, oct or bin enter the information and select the one you
want it converted to
--------------

have tried, but can no get result represented as in my example, and this
calculator is not too convenient.

thank you.
 
S

Stan Weiss

decimal-hex-binary can be done using the calculator that comes with
Windows.
I am on a W2k machine. In view change to scientific mode you can that
select hex, dec, oct or bin enter the information and select the one you
want it converted to
 
J

Jim

1Adata said:
is there simple standalone freeware utility to convert decimal-hex-binary
values?

0 = 0xFFFF = 1111 1111 1111 1111
1 = 0xFFFE = 1111 1111 1111 1110
2 = 0xFFFC = 1111 1111 1111 1100
3 = 0xFFF8 = 1111 1111 1111 1000
...
can no find one that preserve results exactly in this format.
Shouldn't the requested format be:
0 = 0x0000 = 0000 0000 0000 0000
1 = 0x0001 = 0000 0000 0000 0001
2 = 0x0002 = 0000 0000 0000 0010
3 = 0x0003 = 0000 0000 0000 0011

If this format is what you want, be prepared to write a program yourself.

Jim
 
T

Terry R.

The date and time was Tuesday, June 02, 2009 9:48:03 AM, and on a whim,
1Adata pounded out on the keyboard:
is there simple standalone freeware utility to convert decimal-hex-binary
values?

0 = 0xFFFF = 1111 1111 1111 1111
1 = 0xFFFE = 1111 1111 1111 1110
2 = 0xFFFC = 1111 1111 1111 1100
3 = 0xFFF8 = 1111 1111 1111 1000
...
can no find one that preserve results exactly in this format.

http://faculty.plattsburgh.edu/albert.cordes/DECBIN.HTML


Terry R.
 
P

Pegasus [MVP]

1Adata said:
--------------

have tried, but can no get result represented as in my example, and this
calculator is not too convenient.

thank you.

Instead of saying "this calculator is not too convenient", I recommend you
say what sort of convenience you require. If you don't then respondents are
forced to guess what you might like and what you might not like. For
example, are you after a GUI or a command line converter? Keyboard input or
file input? Screen output or file output? What range of numbers are you
looking at? You should also explain why you think that 2 = 0xFFFC.
 
P

Pegasus [MVP]

Stan Weiss said:
Looking at your example 0 = 0xFFFF = 1111 1111 1111 1111 My question is
where is your decimal number?

I think your clock or time zone setting is out. You're posting in the
future.
 
H

HeyBub

1Adata said:
is there simple standalone freeware utility to convert
decimal-hex-binary values?

0 = 0xFFFF = 1111 1111 1111 1111
1 = 0xFFFE = 1111 1111 1111 1110
2 = 0xFFFC = 1111 1111 1111 1100
3 = 0xFFF8 = 1111 1111 1111 1000
...
can no find one that preserve results exactly in this format.

Of course not. The equations you offer are wrong, i.e.,

0 = 0x0000 = 0000 0000 0000 0000

They are not even negatives:

-1 = 0xFFFF = 1111 1111 1111 1111
 
S

Stan Weiss

1Adata said:
--------------

have tried, but can no get result represented as in my example, and this
calculator is not too convenient.

thank you.

Looking at your example 0 = 0xFFFF = 1111 1111 1111 1111 My question is
where is your decimal number?
 
1

1Adata

HeyBub said:
Of course not. The equations you offer are wrong, i.e.,

0 = 0x0000 = 0000 0000 0000 0000

They are not even negatives:

-1 = 0xFFFF = 1111 1111 1111 1111
----------

sorry I was mistaken, I got confused, it looks the correct is only hex to
binary conformity, the decimal numbers are wrong.
Its just communication with microcontroller, there is a sort of counter, for
instance, when a card has three rides left the value is
0xFFF8 (1111 1111 1111 1000). Two rides equals 0xFFFC (1111 1111 1111 1100),
one ride equals 0xFFFE
(1111 1111 1111 1110) and no rides equals 0xFFFF (1111 1111 1111 1111). But
looks decimal numbers does not conform the hex and binary format.
 
J

Jim

1Adata said:
----------

sorry I was mistaken, I got confused, it looks the correct is only hex to
binary conformity, the decimal numbers are wrong.
Its just communication with microcontroller, there is a sort of counter,
for
instance, when a card has three rides left the value is
0xFFF8 (1111 1111 1111 1000). Two rides equals 0xFFFC (1111 1111 1111
1100),
one ride equals 0xFFFE
(1111 1111 1111 1110) and no rides equals 0xFFFF (1111 1111 1111 1111).
But
looks decimal numbers does not conform the hex and binary format.
It is the card which is confusing you. It is not reporting its status in
normal format. The only way to get a report in the format that you desire
is to prepare your own program.

In essence, hex FFFF equals -1 decimal.
Hex FFFe = -2 decimal
Hex FFF8 = -32 decimal

This is true for a machine which uses 2's complement arithmetic.

Jim
 
1

1Adata

Jim said:
It is the card which is confusing you. It is not reporting its status in
normal format. The only way to get a report in the format that you desire
is to prepare your own program.

In essence, hex FFFF equals -1 decimal.
Hex FFFe = -2 decimal
Hex FFF8 = -32 decimal

This is true for a machine which uses 2's complement arithmetic.

Jim
 
S

Stan Weiss

1Adata said:
-----------

I have no task to get report in my custom format, just trying to understand
how to program card if I need charge card for 10-rides or 20-rides, what
data I should write to card?

Based on the logic shown by your example
0 = 0xFFFF = 1111 1111 1111 1111
1 = 0xFFFE = 1111 1111 1111 1110
2 = 0xFFFC = 1111 1111 1111 1100
3 = 0xFFF8 = 1111 1111 1111 1000

16 = 0x0000 = 0000 0000 0000 0000 will be the highest you can go
 
B

Bob I

If you write 0 decimal to the card you get 16 rides.

Using the 10 rides for example you will need 6 ones and 10 zeros. So,
if you look at Windows Calculator in Bin mode and hit 1111 11 then 00
0000 0000, and then select Dec. You will see that you need to put 64512
on the card.
 
J

Jim

What the card is reporting is the number of cleared bits. Hence, you would
need 20 bits to get to 20-rides.
Jim
 
P

Paul

Bob said:
If you write 0 decimal to the card you get 16 rides.

Using the 10 rides for example you will need 6 ones and 10 zeros. So,
if you look at Windows Calculator in Bin mode and hit 1111 11 then 00
0000 0000, and then select Dec. You will see that you need to put 64512
on the card.

All this to ride the bus ? :)

http://www.rigainside.info/2009/05/public-transport-riga-how-much-and-how.html

*******

Why not buy the denomination of card to be duplicated, and just
read the number off it, and then again after each ride. That way,
you can generate a table of values.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top