Subj
Posted on 2002-11-09 14:35:23 by The Svin
A game the whole family can enjoy! :grin:

Needs a flashing timer and scoring system.

Name, seconds, incorrect, conversions, score

score = conversions * (conversions - incorrect) / seconds

First conversion does not count - just a warm up.
Posted on 2002-11-09 15:04:54 by bitRAKE
Thanks for scoring system idea.
Hex to bin is boring(too easy), I'd better use it in dec to
and
bin to dec version (I posted that one before)
Or even better - will make test app with 6 ways to
convert between bin,hex,dec. Using tabs, maybe to switch between variant of the convertion game.
What do you think of timer? (sec or msec? or something else?)
Posted on 2002-11-09 15:26:50 by The Svin
Interesting side note,

Svin is the only member of this board that i have a separte directory named after him. Its solely devoted for the many interesting trinkets and tools he is continously dreaming up...

Thanx again Svin :alright:

:nAn:
Posted on 2002-11-11 20:20:42 by NaN
Thank you, Nan!
Next one. I'm going to add comments on the app in a short while.
Posted on 2002-11-28 01:50:46 by The Svin
To be able to associate dec or hex value with
its binary representation is one of most usefull in creating
programm in low level programming language,
especially working on math algorithms that effectivly
involve into solution not only math instructions
but also (using specifics of positioning numeric system)
data transfer operations and booling logic instructions.

I'm not going to talk you in it now, If you already have the
ability - you know what I'm talking about, if you don't -
you'll know after you have, untill the time there is no way
to show you if this is true.

This simple utility help you train your ability for dec to bin
convertion, progressively, step by step increasing difficulty of
this task specifying a range in what values to convert to be generated.

Depending on which way you are going to do it, working with the app
will train two auxilary abilities that can be used for the task:
1. Division by 2.
2. Memorizing values of power of 2.

In any way it also trains you ability to keep values in your mind,
make calculations in your mind and memorizing things.

Both ways aim to represent decimal values as sum of powers of two.
Example: 13(dec)
= 8+4+1 = 2^3 +2^2+2^0 = 1101 (binary)
value of power shows you indexes of bits you need to set to 1, bits with rest indexes
are to be set to 0.

First way is easier with low values.
The way involves memorizing values of power of two.
For example you set difficulty to lowest level: 4 bit.
Every bit represent power of 2 equal to index of bit:
bit[0] = 2^0 = 1
bit[1] = 2^1 = 2
bit[2] = 2^2 = 4
bit[3] = 2^3 = 8

You start convertion with highest bit in example: bit[3]
If value >= 2^3 you set the bit to 1 and substuct 2^3=8 from value
else leave 0 in bit
if remaining after substruction value >= 2^2 you set bit to 1 and substruct 2^2 from remaining value
else leave 0 in the bit
and so on untill you have 0 in remaining value.

Example dec value 9
9 > 8 -> set bit[3] to 1 9-2^3=9-8=1
1< 4 set bit[2] to 0
1< 2 set bit[1] to 0
1=1 set bit[0] to 1 1-2^1=1-1=0 we are done.

dec value 12
12 > 8 set bit[3] to 1 12-8=4
4 = 4 set bit[2] to 1 4-4= 0 we are done - > set all bits after bit[2] to zero.

After you get used to (get memorized) values of fisrt 4 powers of 2, you learn
next 4 powers of 2
2^4 = 16 (bit[4])
2^5 = 32 (bit[5])
2^6 = 64 (bit[6])
2^7 = 128 (bit[7])

set difficulty to 8 bits and train recalling now already 8 powers of 2.

And so on.
So it mostly train your memory.

After a time you begin recall some low decimal values binary representation,
this will allow you to make it quicker.
For example (8 bit difficulty) 135
128 < 135 -> set bit [7](2^7=128) to 1 135-128=7

and now you recall that 7 can be represented in 3 lowest bits as 111
so you set those bits and you are done.

Second way is harder but it doesn't need memorize powers of two.
It starts from lowest bit.
It uses devision by two and you set bit according to reminder
(as you understand reminder may be only 1 or 0)
it goes untill quontien of division is 0 (and in the case if value wasn't zero last
reminder will ever be 1)
Reminder is 1 only when you devide odd number by 2.
So if you have odd number - set bit to 1 then divide (the number - 1) by two and
go to the next bit (upper bit)

I hope you'll find the app usefull.
Posted on 2002-11-28 02:55:56 by The Svin
Previous version is useful to memorize
powers of 2 groupped in nibbles.
But it doesn't let you graduatly increase difficalty
increasing max binary digits in step one.
In this version you can specify factor in step 1.
In other words you can specify any number
from 4 to 32 as maximum bits in generated for
test numbers.
If you need source - let me know.
Posted on 2002-11-29 02:16:51 by The Svin
Number of digits in decimal representation of power of two.
LET
n:10 = x (quontient) and y reminder
then number of digits in 2^n in decimal will be
x*3+1 + quontien of |y-1|:3
Example:
2^127
x=12
y=7
3*12+1+|7-1|:3=39 digits.

It also possible easily to know first decimal digit of power of 2
for the first 50 powers in decimal
it will be member in a raw (zero based)
1,2,4,8,1,3,6,1,2,5
Examples:
2^15
y=5
first digit in decimal 3
2^0
y=0
first digit in decimal 1
Posted on 2002-12-04 12:03:39 by The Svin
This Lemma will help you to find binary representation
of decimal value that is close but less than known to you
power of 2.
LEMMA:
if x= 2^n-1 and y < x then
x-y=x xor y
(c)
(let me know if you need proof or explanetion)

How to use it.
For example you see decimal value that is close to
known 2^n but less how to find fast binary represantion of this value?
Find difference between 2^n-1 and value .
Let 2^n-1 - value = x
Place n lowbits to 1 (let's name it y). Set all bits that are 1 in x to 0 in y.
Example.
For example you see 4087 and you know that 4096 is 2^12
1. Set low 12 bits to 1 1111 1111 1111
2. Find difference 4096-1 -4087 = 8
3. Set bits that is 1 in 8 (1000) to 0 in (1.) = 1111 1111 0111b is 4087d
Posted on 2002-12-05 11:05:43 by The Svin
A little addition as a hint (and also flashing
to memory value in front of your eyes )
in down left corner you can see hex value
of binary value you are setting by buttons
Posted on 2002-12-05 12:44:33 by The Svin
Another one for Zen meditations :)
Train calculations (memorizing) powers of 2.
I haven't implemented regeneration of test numbers
in case you lookup reference tab.
So you can cheat, just remember that you
can cheat this way with nobody but yourself ;)
Let me know if you need the source.
Posted on 2002-12-21 11:27:59 by The Svin
Neat idea, but kinda outa control i find.

Having numbers jump around on the top doesnt help much.. and the second menu has me lost what your intent is?

However the third tab is good practice, but its pretty hard to remember the insignificant digits for 2^29.. (512M is not an exceptable answer).

For those interested there is a quick rule of thumb:

1.0) Memoryize 2^0 --> 2^9 (1,2,4,8,16,32,64,128,256,512)
2.0) Memorize that 2^10 == 1k == 1024
3.0) Recal that exponents are additive when the base is common (grade 8 math)

Hence

2^29 == 2^10 * 2^10 * 2^9 == 512 * k * k == 512M
2^17 == 2^10 * 2^7 == 128k

In essence you can think of every 2^10 as THREE ENGINEERING UNITS on your calculator 1,000,000,000,000 == 2^40 (four commas ;) )

:alright:
NaN
Posted on 2002-12-22 22:21:02 by NaN
Having numbers jump around on the top doesnt help much..

Of course, it's kinda provocation :)
Relay on your brain not reference.
But also flashing stuff reflects on mind, even if you can
as you think recognize what is written.
So it's not only provocation, also decoration and somehow reflecting in mind stuff.

and the second menu has me lost what your intent is?


You need to tell exponent.
When you see for example 512 press 9 button.
It's easier then calculate or recall decimal representation,
but also usefull so testing yourself on this one you get
impression of relation between decimal and bynary exponants of the same value.
Posted on 2002-12-23 13:48:37 by The Svin
Ah... gotcha thanx.. so your looking for the 'log(2) Number=?'
Posted on 2002-12-23 16:30:09 by NaN

Ah... gotcha thanx.. so your looking for the 'log(2) Number=?'

yes it is called exponent
2^145
2 is base
145 is exponent
Posted on 2002-12-23 17:17:22 by The Svin