Boolean logic is a type of logic that is used in computer programming and digital electronics to make logical decisions. It uses a binary system of 1's and 0's to represent true and false, and logical operators such as AND, OR, and NOT to combine and manipulate these values. Boolean logic is fundamental to many programming languages and is used in everything from creating basic IF/ELSE statements to more complex decision-making algorithms.
The CPU (Central Processing Unit) typically consists of an arithmetic logic unit (ALU), floating point unit (FLU/FPU), registers, control unit and the cache memory.
The ALU performs integer arithmetic operations such as addition, subtraction, and logic operations such as AND, OR, XOR, etc. Integers are whole numbers without fractional components. 1, 2, and 3 are integers while 0.1, 2.01, and 3.005 all have fractional components and are called floating point numbers.
What is ASCII Code ?
ASCII (American Standard Code for Information Interchange) code is a standard system used to represent text characters as numeric codes in digital electronics and computing. In ASCII code, each character is assigned a unique 7-bit code, allowing for a total of 128 possible characters.
For example, the letter "A" is represented in ASCII code as the number 65. The letter "B" is represented as the number 66, and so on. Punctuation marks, numbers, and special characters also have unique ASCII codes.
Binary Addition
Let's say we want to add the binary numbers 101011 and 11100 together. First, we want to line up the digits, making sure each column is added correctly.
1 0 1 0 1 1 + 0 1 1 1 0 0
There are two types of complements in a binary number system: the one's complement and the two's complement.
One's Complement
To find the one's complement of a binary number, you simply need to flip all the bits (0 becomes 1 and 1 becomes 0) in the binary number. For example:
Binary number : 11001101 One's complement : 00110010