View Single Post
  #13  
Old 01-27-2020, 11:36
chants chants is offline
Family
 
Join Date: Jul 2016
Posts: 513
Rept. Given: 5
Rept. Rcvd 34 Times in 20 Posts
Thanks Given: 434
Thanks Rcvd at 778 Times in 360 Posts
chants Reputation: 34
Well the last bit of numbers never change so
Odd -> odd, even -> even, in fact even last 2 bits are constant, so modulo 4 constant and simple mapping of the other 2 bits.
Also the last 4 bits are easy one to one mapping
0 to C
1 to 5
2 to 2
3 to B
4 to 0
5 to 9
6 to 6
7 to F
8 to 4
9 to D
A to A
B to 3
C to 8
D to 1
E to E
F to 7
So remainder 2 stays same, remainder 0 adds C, remainder 1 adds 4, remainder 3 adds 8, all of these modulo 16, to keep 4 bits. Easy to write as a formula in a variety of ways from boolean equations to division and modulo or doing some bit twiddling.

I don't see how the first 12 bits are derived though
Reply With Quote
The Following 2 Users Say Thank You to chants For This Useful Post:
Abaddon (01-27-2020), mcr4ck (01-27-2020)