Is there source code and already made tool that can read Binary number like stryker did here 1,1,2,3,5,8,13,21,34,55,89 .. I can beary add but i better learn how to do thing now if i expect to call myself an programmer one day...I am seaching the board right now but I don't really know what i am looking at... A tool would be very helpful so that i can learn the numbers and compare to the letters it represent...

Thanks
Posted on 2002-07-22 20:03:34 by cmax
You mean the Fibonacci number sequence?
Posted on 2002-07-22 20:19:01 by comrade
HEX is what i am trying to read... I need a tool that do the reading an that is the best an fastest way for me to learn how to do it... I louzy in math so i need DOC'S and tools. Everything is about HEX anyway and it time for me to really understand more about it....

Thanks

Ps: That's why i am afarid of math not knowing what stuff like this mean....Fibonacci number sequence

What's that :confused:

Maybe my question shoud be How to Convert a STRING of hex numbers to English so that i can read it FIRST than learn how to code in hex from there...By the way comrade welcome Home, i think you were missing for a while a few months back.

Thanks Again
Posted on 2002-07-22 20:49:30 by cmax
How to Convert a STRING of hex numbers to English
[size=9].686

.MODEL FLAT, STDCALL
OPTION CASEMAP:NONE
INCLUDE \masm32\INCLUDE\windows.inc
INCLUDE \masm32\INCLUDE\kernel32.inc
INCLUDE \masm32\INCLUDE\user32.inc
INCLUDELIB \masm32\lib\user32.lib
INCLUDELIB \masm32\lib\kernel32.lib
INCLUDE \masm32\INCLUDE\masm32.inc
INCLUDELIB \masm32\lib\masm32.lib

.DATA

HexString DB "48656C6C6F20437275656C20576F726C64", 0 ;"Hello Cruel World"

.DATA?

HexBuffer DB 3 DUP(?)
TxtBuffer DB 1024 DUP(?)

.CODE

HexStr2TxtStr PROC USES ebx esi edi lpszHexString:DWORD, lpszTextBuffer:DWORD, szHexBuffer:DWORD

mov ebx, szHexBuffer
xor eax, eax
mov esi, lpszHexString
xor ecx, ecx
mov edi, lpszTextBuffer

@@:

mov ax, WORD PTR [esi+ecx*2]
mov WORD PTR [ebx], ax
push ecx
invoke htodw, ebx
pop ecx
mov WORD PTR [edi+ecx], ax
inc ecx
cmp BYTE PTR [esi+ecx*2+1], 0
jne @B

ret

HexStr2TxtStr ENDP

START:
invoke HexStr2TxtStr, OFFSET HexString, OFFSET TxtBuffer, OFFSET HexBuffer
invoke MessageBox, 0, OFFSET TxtBuffer, 0, 0
invoke ExitProcess,NULL
END START[/size]
Code not tested on Unicode strings. :)
Posted on 2002-07-22 21:25:45 by stryker
Thanks stryker

I really needed something to work with so that i can see what some of these numbers really mean so i can catch up a little. I would give up to fast if i had to read books forever and piece it all to gether...This should do it.
Posted on 2002-07-23 02:46:02 by cmax
CMax you want to know how to count in hex?
Or do you want to know about the Fibonacci sequence?

The list of numbers you gave (1, 1, 2, 3, 5, 8, ...) is the Fibonacci sequence, and is calculated as follows:
element = element + element.
Where element[0] = 1, and element[1] = 1.

element[2] = 1 + 1
element[3] = 2 + 1
element[4] = 3 + 2
element[5] = 5 + 3
element[6] = 8 + 5
element[7] = 13 + 8
and so on...

If you want to know how to count in hex, then you must understand the basics of counting in any base (radix if you prefere).
B = base (decimal B = 10, hex B = 16, binary B = 2 etc.).

In base B we have a total of B symbols with which to describe our number (0 -> B-1).
Once we have a number greater than (B - 1) we need to extend our counting system to deal with this new larger number. A second character is added to the string.

If we count from 0, the Nth character in the string = (B^N) * value denoted by that character.

Hence 5 in decimal = 0005 = (10^0) * 5 = 1 * 5 = 5
If we count in hex, 000Ah = (16^0) * 10 (A is the 10th symbol in hex) = 1 * 10 = 10

00ABh = ((16^1) * 10) + ((16^0) * 11) = (16 * 10) + (1 * 11) = 160 + 11 = 171 = 0ABh

0100h = (16^2) * 1) + (16^1) * 0) + ((16^0) * 0) = 256 + 0 + 0...

The same is true for binary, but instead of 16s we replace it with 2s:
01010101b =
((2^6) * 1) + ((2^5) * 0) + ((2^4) * 1) + ((2^3) * 0) + ((2^2) * 1) + ((2^1) * 0) + ((2^6) * 1) =
64 + 16 + 4 + 1 = 85

This is the basic method by which all modern systems of counting work (where the base is an integer). It can be applied to any other base, all you need to do is come up with a symbol table for the numbers (of course there is a precident - 0, 1, 2, 3, ..., 9, A, B, ...).

Mirno
Posted on 2002-07-23 08:31:35 by Mirno
Where element[0] = 1, and element[1] = 1

Where element[0] = 0, and element[1] = 1
Posted on 2002-07-23 16:42:24 by The Svin