[HN Gopher] The Magic of Bits "Bitwise"
       ___________________________________________________________________
        
       The Magic of Bits "Bitwise"
        
       Author : CoolerVoid
       Score  : 13 points
       Date   : 2022-07-11 04:35 UTC (1 days ago)
        
 (HTM) web link (antonio-cooler.gitbook.io)
 (TXT) w3m dump (antonio-cooler.gitbook.io)
        
       | jhgb wrote:
       | Reminded me of Thinking Forth (http://thinking-
       | forth.sourceforge.net). Lookup tables FTW.
        
       | efortis wrote:
       | In words, you can think of XOR as: True when both bits are
       | different.
       | 
       | ---
       | 
       | Although the post is an introduction, I wanted to share a nice
       | tip for coding multiplexers with bitwise operations:
       | 
       | https://blog.uidrafter.com/bitwise-table-lookup
       | 
       | ---
       | 
       | And here's a fun example, KITT-like lights, for practicing
       | bitwise operations:
       | 
       | https://ericfortis.github.io/web-animations/#-kitt-like-ligh...
       | 
       | Source Code:
       | 
       | https://github.com/ericfortis/web-animations/blob/main/kitt-...
        
       | parasti wrote:
       | The target audience seems to be an intersection of people who are
       | decently familiar with C and people who haven't been exposed to
       | bitwise arithmetic.
        
         | m_antis89 wrote:
         | and, it doesn't seem to be proofread.
        
       | yababa_y wrote:
       | one of my pet peeves of common computers is that they don't have
       | a generalized LUT2 instruction. why do you pick out a handful of
       | specific bitwise ops for me when all 16 are lying in reach! a
       | mere 4 bit look up table!                   let ix = a | b<<1
       | (lut & (1 << ix)) >> ix
        
       | valbaca wrote:
       | The book linked at the bottom is a treasure trove of bitwise fun:
       | 
       | "Hackers Delight" https://www.amazon.com/Hackers-Delight-2nd-
       | Henry-Warren/dp/0...
        
       | tmountain wrote:
       | One fun way to get familiar with bitwise operations is writing a
       | virtual machine, as it involves a lot of masking and shifting
       | bits from instructions to extract relevant pieces (dare I say
       | bits) of information. If anyone is interested in going this
       | route, I recommend LC-3, as it's very straightforward.
       | 
       | https://www.jmeiners.com/lc3-vm/
        
       ___________________________________________________________________
       (page generated 2022-07-12 23:03 UTC)