Binary to "255-number-system"
Binary to "255-number-system"
Anyone who knows how to convert a binary number to a number in a "255-siffer-system"? (Not in purebasic, just math in general)
Re: Binary to "255-number-system"
What is the 255-siffer-system?
-
Doobrey
- Enthusiast

- Posts: 218
- Joined: Sat Apr 26, 2003 4:47 am
- Location: Dullsville..population: me
- Contact:
Re: Binary to "255-number-system"
I think he means cypher ?GPI wrote:What is the 255-siffer-system?
Doesn`t make any difference, I`m still confused :roll:
More concrete
binary = 01011001 (2-siffer-system)(0,1)
Decimal = 89 (10-siffer-system)(0,1,2,3,4,5,6,7,8,9)
Hexadecimal = 59 (16-siffer-system)(0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f)
"My system" = ? (255-siffer-system)(0,1....ABC...abc...!.,:...)
Decimal = 89 (10-siffer-system)(0,1,2,3,4,5,6,7,8,9)
Hexadecimal = 59 (16-siffer-system)(0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f)
"My system" = ? (255-siffer-system)(0,1....ABC...abc...!.,:...)
Are you trying to list the ASCII table (and in wrong order i must say) !?!
I don't get this 255 number system..
:roll:
-Lars
I don't get this 255 number system..
-Lars
AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
I've always heard these number systems refered to as "Base" systems.
Base 2 is the binary counting... 10101 etc.
Base 10 is what (most) humans use, I guess cause we have 10 fingers.
Base 16 for computers (hexadecimal)
Now Base 255, you would of course have to create your own character set to represent everything since I'm pretty sure there is no standard for it
Base 2 is the binary counting... 10101 etc.
Base 10 is what (most) humans use, I guess cause we have 10 fingers.
Base 16 for computers (hexadecimal)
Now Base 255, you would of course have to create your own character set to represent everything since I'm pretty sure there is no standard for it
>binary = 01011001 (2-siffer-system)(0,1)
76543210
= 0*2^7+1*2^6+0*2^5+1*2^4+1*2^3+0*2^2+0*2^1+1*2^0
>Decimal = 89 (10-siffer-system)(0,1,2,3,4,5,6,7,8,9)
= 8*10^1+9*10^0
>Hexadecimal = 59 (16-siffer-system)(0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f)
= 5*16^1+9*16^0
"My system" = ? (255-siffer-system)(0,1....ABC...abc...!.,:...)
GPI
76543210
= 0*2^7+1*2^6+0*2^5+1*2^4+1*2^3+0*2^2+0*2^1+1*2^0
>Decimal = 89 (10-siffer-system)(0,1,2,3,4,5,6,7,8,9)
= 8*10^1+9*10^0
>Hexadecimal = 59 (16-siffer-system)(0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f)
= 5*16^1+9*16^0
"My system" = ? (255-siffer-system)(0,1....ABC...abc...!.,:...)
Code: Select all
DEZIMAL=1123454
base=256
a=DEZIMAL
a$=""
For i=9 To 0 Step -1
b=Pow(base,i)
digit=a/b
a-digit*b
a$+" "+Str(digit)
Next
Debug "dezimal:"+Str(DEZIMAL)
Debug "Base "+Str(base)+":"+a$
Debug 17*256*256+36*256+126Second edition
Base below 37: Use the Alphabet for additonal digits.
above 36: Write "digits" direct, like 123 534 732
Code: Select all
c$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
DEZIMAL=1123454
base=32;Len(c$)
a=DEZIMAL
a$=""
For i=19 To 0 Step -1
b=Pow(base,i)
If b>0
digit=a/b
a-digit*b
If digit>0 Or a$<>""
If base<=Len(c$)
a$+Mid(c$,digit+1,1)
Else
a$+Str(digit)+" "
EndIf
EndIf
EndIf
Next
Debug "dezimal:"+Str(DEZIMAL)
Debug "Base "+Str(base)+":"+a$
dez=0
If base<=Len(c$)
*adr.Byte=@a$
While *adr\b
dez*base
dez+FindString(c$,Chr(*adr\b),0)-1
*adr+1
Wend
Else
k=1
Repeat
b$=StringField(a$,k," "):k+1
If b$
dez*base
dez+Val(b$)
EndIf
Until b$=""
EndIf
Debug "Re-Dezimal:"+Str(dez)
above 36: Write "digits" direct, like 123 534 732




