Bit Manipulation

This post is about Bit Manipulation. I will add more content later.

I tend to forget how negative integers are represented in binary a lot. So here is how:

base 10     base2(using two's complement)
 18             00010010
-18             11101110


  0010010
+1101101 +1
------------------
 01111111 +1

Step1: We first flip the digit of positive 18  = 1101101

  0010010
+1101110
------------------
10000000

Step2: and then add 1 to it. 1101101 + 1  = 1101110


1 1101110 is negative 18, the first 1 is the sign.

Masks

Comments

  1. Green Gaming is our award-winning methodology for ensuring protected and sound playing in}. With assist of|assistance from|the help of} our ingenious Green Gaming software, players can examine their betting habits and decide whether it is sound or unsafe. The software comprises of a straightforward self-evaluation test that we mix with 우리카지노 individual data on precise game-play to compute a playing habits profile. This data is then used to make a customized suggestion for a healthy playing in} habits. In 2017, we launched a predictive software known as Green Gaming, which is our answer to accountable and protected gaming.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to scale a website-My Approach

What is functional programming?