memory address 4000h whats the h mean?

Door OddballNo3

Supporter (6)

afbeelding van OddballNo3

03-01-2021, 23:28

So this has been bugging me for a while.. what does the h stand for? I've googled, and i get that it designates a base 16 hexadecimal. which aren't most / everything storage related base 16 in computers? so its redundant? like a 200R resistor the R lets you know its a 200 ohm, where if it wasn't there you would assume its a 200 and be right? and its there to make newbs ask silly questions? that about right? Question

Aangemeld of registreer om reacties te plaatsen

Van Daemos

Paragon (1948)

afbeelding van Daemos

03-01-2021, 23:35

It stands for hexadecimal.
This means that the number 4000 is in hexadecimal form. Hexadecimal numbers count to 16 opposed to the decimal numbers we normally use. That means we have 1 2 3 4 5 6 7 8 9 A B C D E and F

In assemblers we use all kind of different ways to tell the assembler what type of number to use.

For example: $4000, 4000h
When using binary: %01010101 or 01010101b
Decimal speaks for itself.

Van Pencioner

Scribe (1419)

afbeelding van Pencioner

03-01-2021, 23:37

OddballNo3 wrote:

so its redundant? like a 200R resistor the R lets you know its a 200 ohm, where if it wasn't there you would assume its a 200 and be right?

no, 4000h = 16K = 16384 so you don't omit this 'h' from number

Van ToriHino

Paladin (710)

afbeelding van ToriHino

03-01-2021, 23:40

The h (or &h or 0x) identifier is needed to differentiate between hexadecimal and decimal values. Both hexadecimal and decimal values can be used mixed together.

For example 4000h (which is hexadecimal) and 4000 (which is decimal) are really different values(4000h is the same as decimal value 16384) so it is not redundant.

Van Pencioner

Scribe (1419)

afbeelding van Pencioner

03-01-2021, 23:44

I suggest you to read this link for some understanding

Van OddballNo3

Supporter (6)

afbeelding van OddballNo3

04-01-2021, 03:14

I get the hex system. Just always bugged me. been fighting trying to burn a eprom for a while now and failing, and that h gets all the hate from me today lol