Raised This Month: $51 Target: $400
 12% 

[TUT] Hexadecimal system


Post New Thread Reply   
 
Thread Tools Display Modes
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-17-2011 , 02:25   Re: [TUT] Hexadecimal system
Reply With Quote #11

Quote:
Originally Posted by jim_yang View Post
what should it cover ? It's just a numeral system, nothing to explain on higher than 0x10
Coz i dont get what 0xF0FFF really means (16 * 15 + 0 +15 +15 +15 ? )
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-17-2011 , 02:38   Re: [TUT] Hexadecimal system
Reply With Quote #12

10111 = 1*10^4 + 0*10^3 + 1*10^2 + 1*10^1 + 1
so
F0FFF you know how to calculate...
just replace 10 with 16
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
diablix
Senior Member
Join Date: Jan 2010
Location: Warsaw, Poland
Old 08-17-2011 , 06:00   Re: [TUT] Hexadecimal system
Reply With Quote #13

My bad with 0xA

Why easier to convert into binary?

0x13

1 = 0001
3 = 0100

0x12 = 00010100B
diablix is offline
Send a message via Skype™ to diablix
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-17-2011 , 08:26   Re: [TUT] Hexadecimal system
Reply With Quote #14

Quote:
Originally Posted by nikhilgupta345 View Post
Could you explain 'bit masks' a little bit more and the usage in AMXX scripting?

Thanks.
There are a number of uses, one example is in my nvault_util include. Reading data from a nvault file requires data types other than 4-byte longs. Since Pawn only has a 4-byte long data-type, bit-masks are needed to get only particular bits\bytes of data (1 or 2 bytes) from the 4-byte long.
PHP Code:
    //4 byte long being read, we use all data so no mask required.
    
fread_rawiVaultHandle DataBuffer BLOCK_INT );
    
iTimeStamp DataBuffer];
    
    
//1 byte being read, we only need the first 8 bits (1 byte) of data
    
fread_rawiVaultHandle DataBuffer BLOCK_BYTE );
    
iKeyLen DataBuffer] & 0xFF;

    
//2 byte short being read, we only need the first 16 bits (2 bytes) of data    
    
fread_rawiVaultHandle DataBuffer BLOCK_SHORT );
    
iValLen DataBuffer] & 0xFFFF
Quote:
Originally Posted by jim_yang View Post
what should it cover ? It's just a numeral system, nothing to explain on higher than 0x10
Quote:
Originally Posted by jim_yang View Post
10111 = 1*10^4 + 0*10^3 + 1*10^2 + 1*10^1 + 1
so
F0FFF you know how to calculate...
just replace 10 with 16
There is more that can be explained. He simply says x = 16 and multiply the value in each place by 16. People will be confused and wonder why they cannot calculate numbers.

0xFFF = [ 16 x 16 ] + [ 16 x 16 ] + 16 = 528
0xFFF = 4095

Yes, the same rules apply for all numerical systems but if he is making a tutorial about something he should include how these numbers are calculated (as you did in your above post).
__________________

Last edited by Bugsy; 08-17-2011 at 10:14.
Bugsy is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-17-2011 , 08:43   Re: [TUT] Hexadecimal system
Reply With Quote #15

concern the example he gave, yes, I should take 90999 as a contrastive example.
I assumed that he can count and understand numerical system...
sorry for that.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-17-2011 , 11:40   Re: [TUT] Hexadecimal system
Reply With Quote #16

Quote:
Originally Posted by diablix View Post
0x12 = 00010100B
How the hell did you come up with that?

0x12
1 = 0001
2 = 0010
0x12 = 0001 0010
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
diablix
Senior Member
Join Date: Jan 2010
Location: Warsaw, Poland
Old 08-17-2011 , 14:52   Re: [TUT] Hexadecimal system
Reply With Quote #17

Damn I mean 0x13..

Quote:
Originally Posted by diablix
0x13

1 = 0001
3 = 0100

0x12 = 00010100B
->

Quote:
Originally Posted by diablix
0x13

1 = 0001
3 = 0100

0x13 = 0001 0100
diablix is offline
Send a message via Skype™ to diablix
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-17-2011 , 15:58   Re: [TUT] Hexadecimal system
Reply With Quote #18

1 = 0001
3 = 0011
and
0x13 = 10011

I don't understand what youre trying to show.
__________________

Last edited by Bugsy; 08-17-2011 at 21:02.
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2011 , 16:06   Re: [TUT] Hexadecimal system
Reply With Quote #19

Quote:
Originally Posted by Bugsy View Post
3 = 0011
and
0x13 = 10011

I don't understand what youre trying to show.
He's trying to prove to me that it's easy to convert from hex to binary.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-17-2011 , 16:08   Re: [TUT] Hexadecimal system
Reply With Quote #20

Quote:
Originally Posted by fysiks View Post
He's trying to prove to me that it's easy to convert from hex to binary.
I think he's trying to prove that he doesn't fully understand number systems.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode