0% found this document useful (0 votes)
9 views

Binary Code, Co

Uploaded by

Mustapha Ridwan
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Binary Code, Co

Uploaded by

Mustapha Ridwan
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

Binary code, code used in digital computers, based on a binary number system in which there are only

two possible states, off and on, usually symbolized by 0 and 1. Whereas in a decimal system, which
employs 10 digits, each digit position represents a power of 10 (100, 1,000, etc.), in a binary system each
digit position represents a power of 2 (4, 8, 16, etc.). A binary code signal is a series of electrical pulses
that represent numbers, characters, and operations to be performed. A device called a clock sends out
regular pulses, and components such as transistors switch on (1) or off (0) to pass or block the pulses. In
binary code, each decimal number (0–9) is represented by a set of four binary digits, or bits. The four
fundamental arithmetic operations (addition, subtraction, multiplication, and division) can all be
reduced to combinations of fundamental Boolean algebraic operations on binary numbers. (See the
table below for how the decimal numbers from 0 to 10 are represented in binary.)

Decimal numerals represented by binary digits

decimalbinary conversion

0 0 0 ( 20 )

1 1 1 ( 20 )

2 10 1 ( 21 ) + 0 ( 20 )

3 11 1 ( 21 ) + 1 ( 20 )

4 100 1 ( 22 ) + 0 ( 21 ) + 0 ( 20 )

5 101 1 ( 22 ) + 0 ( 21 ) + 1 ( 20 )

6 110 1 ( 22 ) + 1 ( 21 ) + 0 ( 20 )

7 111 1 ( 22 ) + 1 ( 21 ) + 1 ( 20 )

8 1000 1 ( 23 ) + 0 ( 22 ) + 0 ( 21 ) + 0 ( 20 )

9 1001 1 ( 23 ) + 0 ( 22 ) + 0 ( 21 ) + 1 ( 20 )

10 1010 1 ( 23 ) + 0 ( 22 ) + 1 ( 21 ) + 0 ( 20 )

Digital codes are sequences of symbols used to represent information in digital form. These codes are
essential in various applications, including computing, telecommunications, and digital electronics. Here
are some common types of digital codes:
Binary Code:Binary code is the most basic digital code, using only two symbols: 0 and 1.It is widely used
in computers and digital systems to represent information at the most fundamental level.

Gray Code:Gray code is a binary numeral system in which two consecutive values differ in only one bit. It
is often used in rotary encoders and in applications where minimizing errors during transitions is crucial.

BCD (Binary Coded Decimal):BCD represents decimal numbers using a 4-bit binary code for each digit.
Each decimal digit is represented by its binary equivalent, making it easy to convert between binary and
decimal.

Excess-3 Code:Also known as XS-3 or 8421-3, excess-3 code adds 3 to each decimal digit and then
represents the result in binary. It is used in some applications for error detection and correction.

ASCII (American Standard Code for Information Interchange):ASCII is a character encoding standard that
uses a 7-bit binary code to represent text characters, including letters, numbers, and special symbols.
Extended ASCII uses 8 bits and provides additional characters.

Unicode:Unicode is a character encoding standard that aims to represent every character from every
language in the world. It uses variable-length encoding, with common characters represented by fewer
bits and less common characters represented by more bits.

Morse Code:Morse code represents characters using sequences of dots and dashes. Originally
developed for telegraphy, it is still used in some communication systems, especially in radio
communication.

Huffman Coding:Huffman coding is a variable-length encoding technique used for data compression. It
assigns shorter codes to more frequently occurring symbols, resulting in more efficient compression.

Error-Correcting Codes (ECC):ECCs are codes designed to detect and correct errors in transmitted or
stored data. Examples include Hamming codes and Reed-Solomon codes.

Pulse Code Modulation (PCM):PCM is used to digitally represent analog signals, particularly in audio and
video applications. It samples the amplitude of the analog signal at regular intervals and quantizes the
samples into digital values.

Digital codes are sequences of symbols used to represent information in digital form. These codes are
essential in various applications, including computing, telecommunications, and digital electronics. Here
are some common types of digital codes:

Binary Code:Binary code is the most basic digital code, using only two symbols: 0 and 1.It is widely used
in computers and digital systems to represent information at the most fundamental level.
Gray Code:Gray code is a binary numeral system in which two consecutive values differ in only one bit. It
is often used in rotary encoders and in applications where minimizing errors during transitions is crucial.

BCD (Binary Coded Decimal):BCD represents decimal numbers using a 4-bit binary code for each digit.
Each decimal digit is represented by its binary equivalent, making it easy to convert between binary and
decimal.

Excess-3 Code:Also known as XS-3 or 8421-3, excess-3 code adds 3 to each decimal digit and then
represents the result in binary. It is used in some applications for error detection and correction.

ASCII (American Standard Code for Information Interchange):ASCII is a character encoding standard that
uses a 7-bit binary code to represent text characters, including letters, numbers, and special symbols.
Extended ASCII uses 8 bits and provides additional characters.

Unicode:Unicode is a character encoding standard that aims to represent every character from every
language in the world. It uses variable-length encoding, with common characters represented by fewer
bits and less common characters represented by more bits.

Morse Code:Morse code represents characters using sequences of dots and dashes. Originally
developed for telegraphy, it is still used in some communication systems, especially in radio
communication.

Huffman Coding:Huffman coding is a variable-length encoding technique used for data compression. It
assigns shorter codes to more frequently occurring symbols, resulting in more efficient compression.

Error-Correcting Codes (ECC):ECCs are codes designed to detect and correct errors in transmitted or
stored data. Examples include Hamming codes and Reed-Solomon codes.

Pulse Code Modulation (PCM):PCM is used to digitally represent analog signals, particularly in audio and
video applications. It samples the amplitude of the analog signal at regular intervals and quantizes the
samples into digital values.

What is Boolean Algebra?

Boolean algebra is the study of algebraic operations over binary values. The word "binary" means two,
so there are only two possible values in Boolean algebra: TRUE and FALSE. The value TRUE is often
represented by the number one, while the value FALSE is often represented by the number zero. Similar
to regular algebra, variables can be used as placeholders for potential TRUE or FALSE values.

History of Boolean Algebra

Boolean algebra gets its name from George Boole, who published a work in 1847 titled The
Mathematical Analysis of Logic. Around the same time, Augustus De Morgan published his book titled
Formal Logic. De Morgan's work introduced the idea of logical validity- if a statement is logically valid,
the conclusion will be true if the assumptions (or premises) are true. This was the beginning of binary
valuation and labeling ideas as true or false. The Mathematical Analysis of Logic expanded on the ideas
that were discussed in De Morgan's work, adding an element of algebraic reasoning to binary logic.

Boolean algebra was created by a mathematician, George Boole (1815–1864), as an attempt to make
the rules of logic precise. In the twentieth century, though, it has since found amazing uses in such fields
as digital computing.

As in regular algebra, Boolean algebra uses letters to stand for values and certain symbols to stand for
operations on those values. However, there are only two possible values in Boolean algebra: True (1) or
False (0). Also, the operations in Boolean algebra are not exactly like the addition, subtraction,
multiplication, or division that we are used to seeing in algebra. Instead, we use AND, OR, NOT, and
similar operations. AND is called a conjunction. OR is called a disjunction. NOT is called a negation.

Operations and Truth Tables

Any Boolean variable, p, q, r, etc., may take the value of 1 or 0. This value is called its truth value (1
means True, and 0 means False). The letters may stand for specific statements. For example, p could
stand for ''The sky is blue'' and q could stand for 5 = 6. Clearly, p is true (p = 1), and q is false (q = 0).

A truth table may be used to define each operation. In its simplest form, a truth table lists all the
possible values for each variable in a separate row. Only one variable means there are only two possible
values for it, and so there are two rows. If there are two variables, then there are 4 combinations, hence
4 rows. Three variables will have 8 rows (23). And in general, the number of rows keeps doubling as
more variables are introduced, so that if there are n variables, then the table will contain 2n rows.

Concepts in Boolean Algebra

Similar to regular algebra, Boolean algebra can use variables to represent a potentially TRUE or FALSE
value. These variables can be thought of as placeholders used to create more complex mathematical
statements. If there is one variable, there are two possibilities for that variable: TRUE or FALSE. If there
are two variables, things get more complicated as both variables could be TRUE, both could be FALSE, or
one could be TRUE and one could be FALSE.
Truth possibilities for two variables.

A truth table showing all four value possibilities of two variables.

The three basic operations used to manipulate variables are AND, OR, and NOT. Both AND and OR
connect two variables, while NOT is applied to a single variable. An AND statement is only TRUE if both
variables are TRUE, an OR statement is only TRUE if at least one of the variables is TRUE, and a NOT
statement is TRUE if the attached variable is FALSE. Generally, an AND statement is referred to as a
conjunction, an OR statement is referred to as a disjunction, and a NOT statement is referred to as a
negation. In set theory, an AND statement is equivalent to finding an intersection, an OR statement is
equivalent to finding a union, and a NOT statement is equivalent to finding a complement.

Boolean Algebra Rules

With nested operations and algebraic manipulation, it becomes advantageous to symbolically represent
AND, OR, and NOT. Some common symbols used to represent AND are

; common symbols to represent OR are

; and common symbols to represent "NOT p" are

. In this lesson, AND, OR, and NOT will be written out.

The following properties and laws outline the basic rules of Boolean algebra.

Commutative Property

The commutative property states that the order of the terms does not matter.

In math, it applies to addition and multiplication. For example:


2+3=3+2

2x3=3x2

It simply means that if we switch the numbers around the sum or product is the same.

This is also true for AND and OR operations. This property has two forms:

Commutative property for AND

p AND q = q AND p

Commutative property for OR

p OR q = q OR p

Associative Property

Let's think about this from a math perspective. The associative property states that when you add or
multiply more than two numbers, it does not matter how they are grouped. Your answer will be the
same. In other words, it doesn't matter which numbers 'associate' with each other. For example:

(1 + 2) + 3 = 1 + (2 + 3)

(4 x 5) x 6 = 4 x (5 x 6)

Notice how the parentheses are placed around different numbers on the left side of the equation versus
the right side. But the answer for the left side is the same as the right.

In Boolean Algebra, the associative property concerns the placement of parentheses within an
expression using either two AND operations or two OR operations. This property has two forms:

Associative property for AND

p AND (q AND r) = (p AND q) AND r

Associative property for OR

p OR (q OR r) = (p OR q) OR r
DeMorgan's Theorem

DeMorgan's theorem produces two relevant laws, also called DeMorgan's laws. DeMorgan's laws
outline what happens when a negation is distributed over either an AND operation or an OR operation.
The two laws are as follows:

NOT (p OR q) = (NOT p) AND (NOT q)

NOT (p AND q) = (NOT p) OR (NOT q)

Example of DeMorgan's Theorem

Think about the basic statement, "Kiki drinks coffee or she drinks tea." Letting p equal "Kiki drinks
coffee," and q equal "she drinks tea," the statement can be rewritten as p OR q. The negation of this
statement would be NOT (p OR q). According to DeMorgan's Theorem, the negation of the original
statement can be rewritten as (NOT p) AND (NOT q). Translating this back into plain language, the
negation of the original statement is the same as, "Kiki does not drink coffee and she does not drink
tea."

Complementary Theorem

The complementary theorem is an extension of DeMorgan's theorem by outlining how to negate a long-
expression. The complementary theorem provides three rules when negating a series of operations.

Change each TRUE to a FALSE and each FALSE to a TRUE

Negate each variable

Switch every OR operator to an AND operator, switch every AND operator to an OR operator

Example of the Complementary Theorem

To take the complement of (p AND q) OR (NOT q OR r), negate each variable and switch the operators.

What are the four Boolean algebra operations?

While elementary algebra has four operations, Boolean algebra only has three operations. The three
Boolean algebra operations are conjuction (AND), disjunction (OR), and negation (NOT).
What are the basic rules of Boolean algebra?

The basic rules of Boolean algebra include the three properties (associative, commutative, and
distributive) and three common laws. These laws are the complement laws, identity laws, and double
negation law. The complement laws state that a variable AND its negation will produce FALSE, while a
variable OR its negation will produce TRUE. The identity laws state that a variable AND TRUE will
produce the variable's truth value and that a variable OR FALSE will produce the variable's truth value.
The double negation law states that negating a variable twice produces the truth value of the variable.

What are the basic properties of Boolean algebra?

The three basic properties of Boolean algebra are the commutative, associative, and distributive
properties. The commutative property states that the order of the variable does not matter in OR and
AND operations. The associative property states that parentheses can be moved when two OR or two
AND operations are next to each other. The distributive property describes what happens when an AND
is distributed over an OR operation and what happens when an OR is distributed over an AND operation.

You might also like