Skip to content

Instantly share code, notes, and snippets.

@robjens
Last active November 22, 2015 19:27
Show Gist options
  • Select an option

  • Save robjens/54f9801fef344a1c1b1e to your computer and use it in GitHub Desktop.

Select an option

Save robjens/54f9801fef344a1c1b1e to your computer and use it in GitHub Desktop.
Logic, math, linguistics, computing

In computing, the least significant bit (LSB) is the bit position in a binary integer giving the units value, that is, determining whether the number is even or odd. The LSB is sometimes referred to as the right-most bit, due to the convention in positional notation of writing less significant digits further to the right. It is analogous to the least significant digit of a decimal integer, which is the digit in the ones (right-most) position.

It is common to assign each bit a position number, ranging from zero to N-1, where N is the number of bits in the binary representation used. Normally, this is simply the exponent for the corresponding bit weight in base-2 (such as in 231..20). Although a few CPU manufacturers assign bit numbers the opposite way (which is not the same as different endianness), the term least significant bit itself remains unambiguous as an alias for the unit bit.

By extension, the least significant bits (plural) are the bits of the number closest to, and including, the LSB.

The least significant bits have the useful property of changing rapidly if the number changes even slightly. For example, if 1 (binary 00000001) is added to 3 (binary 00000011), the result will be 4 (binary 00000100) and three of the least significant bits will change (011 to 100). By contrast, the three most significant bits (MSBs) stay unchanged (000 to 000).

In computing, the most significant bit (MSB, also called the high-order bit) is the bit position in a binary number having the greatest value. The MSB is sometimes referred to as the left-most bit due to the convention in positional notation of writing more significant digits further to the left.

The MSB can also correspond to the sign bit of a signed binary number in one’s or two’s complement notation, "1" meaning negative and "0" meaning positive.

It is common to assign each bit a position number, ranging from zero to N-1, where N is the number of bits in the binary representation used. Normally, this is simply the exponent for the corresponding bit weight in base-2 (such as in 231..20). Although a few CPU manufacturers assign bit numbers the opposite way (which is not the same as different endianness), the MSB unambiguously remains the most significant bit. This may be one of the reasons why the term MSB is often used instead of a bit number, although the primary reason is probably that different number representations use different numbers of bits.

By extension, the most significant bits (plural) are the bits closest to, and including, the MSB.

The unsigned binary representation of decimal 149, with the MSB highlighted. The MSB in an 8-bit binary number represents a value of 128 decimal. The LSB represents a value of 1. Most Significant Bit First vs Least Significant Bit First[edit] The expressions Most Significant Bit First and Least Significant Bit First are indications on the ordering of the sequence of the bits in the bytes sent over a wire in a transmission protocol or in a stream (e.g. an audio stream).

Most Significant Bit First means that the most significant bit will arrive first: hence e.g. the hexadecimal number 0x12, 00010010 in binary representation, will arrive as the sequence 0 0 0 1 0 0 1 0 .

Least Significant Bit First means that the least significant bit will arrive first: hence e.g. the same hexadecimal number 0x12, again 00010010 in binary representation, will arrive as the (reversed) sequence 0 1 0 0 1 0 0 0.

Trivia: why do some people use j instead of i?

i is used by engineers and physicists for electrical current, comes from intensité de courant, meaning "current intensity"

Remember: The Imaginary Unit is defined as

i = √-1

Important
Whenever there is a negative under the radical sign, it comes out from underneath as i since the problem will contain a square root of -1. When simplifying these radical numbers in terms of i, follow the usual rules for simplifying radicals and treat the i with the rules for working with a variable.

Hence:

√-25 = √(-1)(25)
= √-1 * 25 = i * 5
= 5i
Set

A set is a collection of distinct objects, considered as an object in its own right (!).

For example, the numbers 2, 4, and 6 are distinct objects when considered separately, but when they are considered collectively they form a single set of size three, written {2,4,6}.

Note
Sets are one of the most fundamental concepts in mathematics. Developed at the end of the 19th century, set theory is now a ubiquitous part of mathematics, and can be used as a foundation from which nearly all of mathematics can be derived.
Galileo’s paradox

Galileo’s paradox is a demonstration of one of the surprising properties of infinite sets. The ideas were not new with him, but his name has come to be associated with them. In his final scientific work, Two New Sciences, Galileo Galilei made apparently contradictory statements about the positive integers.

  1. First, some numbers are squares, while others are not;

  2. therefore, all the numbers, including both squares and non-squares, must be more numerous than just the squares.

  3. And yet, for every square there is exactly one positive number that is its square root,

  4. and for every number there is exactly one square; hence, there cannot be more of one than of the other. This is an early use, though not the first, of the idea of one-to-one correspondence in the context of infinite sets.

Square number

The product of a number multiplied by itself, e.g. 1, 4, 9, 16.

Square root

A square root of x is a number r such that r^2=x.

Premise

A claim that is a reason for, or an objection against, some other claim as part of an argument

A premise is a statement that an argument claims will induce or justify a conclusion. In other words: a premise is an assumption that something is true.

In logic, an argument requires a set of at least two declarative sentences (or "propositions") known as the premises (or premisses) along with another declarative sentence (or "proposition") known as the conclusion.

This structure of two premises and one conclusion forms the basic argumentative structure.

More complex arguments can use a series of rules to connect several premises to one conclusion, or to derive a number of conclusions from the original premises which then act as premises for additional conclusions. So we can say:

Argument

In logic and philosophy, an argument is a series of statements typically used to persuade someone of something or to present reasons for accepting a conclusion. The general form of an argument in a natural language is that of premises (typically in the form of propositions, statements or sentences) in support of a claim: the conclusion. The structure of some arguments can also be set out in a formal language, and formally defined "arguments" can be made independently of natural language arguments, as in math, logic, and computer science.

Rule of inference

In logic, a rule of inference, inference rule or transformation rule is a logical form consisting of a function which takes premises, analyzes their syntax, and returns a conclusion (or conclusions).

For example, the rule of inference called modus ponens takes two premises, one in the form If p then q and another in the form p, and returns the conclusion q. The rule is valid with respect to the semantics of classical logic (as well as the semantics of many other non-classical logics), in the sense that if the premises are true (under an interpretation), then so is the conclusion.

Typically, a rule of inference preserves truth, a semantic property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment