0% found this document useful (0 votes)
13 views8 pages

CSC211; Computer Logic Lecture Notes-2

The document outlines the course content for CSC211: Introduction to Computer Logic, covering fundamental concepts of computer logic, types of logic gates, and their applications in digital systems. It includes detailed explanations of various logic gates such as AND, OR, XOR, NOT, NAND, and NOR, along with truth tables and examples. Additionally, it introduces the concept of a simple comparator circuit and provides assignment instructions for practical applications of logic gates.

Uploaded by

assadiqamlat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views8 pages

CSC211; Computer Logic Lecture Notes-2

The document outlines the course content for CSC211: Introduction to Computer Logic, covering fundamental concepts of computer logic, types of logic gates, and their applications in digital systems. It includes detailed explanations of various logic gates such as AND, OR, XOR, NOT, NAND, and NOR, along with truth tables and examples. Additionally, it introduces the concept of a simple comparator circuit and provides assignment instructions for practical applications of logic gates.

Uploaded by

assadiqamlat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CSC211: Introduction to Computer Logic 2024

Introduction to Computer Logic


Course Content

1. Concept of Computer Logic: This section introduces the fundamental concepts of computer
logic, and its relevance in various fields such as mathematics, science, engineering, business, and
law.
2. Logic Gate and Types of Logic Gate: In this section, we discuss different types of logic gates
used in digital circuits, such as AND, OR, NOT, NAND, NOR.
3. Concept of a Simple Comparator: Introduce the concept of a simple comparator circuit used
for comparing two binary numbers. Explain its logical design and how it can be implemented
using logic gates.
4. Application of Computer Logic Gates: Explore the practical applications of computer logic
gates in digital systems and electronic devices. Discuss how logic gates are used to perform
arithmetic operations, control circuits, memory units, and more.

1. Concept of Computer Logic


Definition of Computer logic

Computer logic is simply define as a set of rules and operations that govern how computers process
and manipulate binary data using Boolean logic, that enable them to do calculations or make
decisions. It is based on building blocks called logic gates that can turn on or off depending on the
input. Computer logic is important for many areas like math, science, engineering, business, and law.

Computer logic is a fundamental aspect of computer science and digital technology. It enables the
creation of powerful computing devices and facilitates the execution of a wide range of tasks, from
simple calculations to complex data analysis and decision-making processes.

Computer logic encompasses several key components:

1. Boolean Logic: Boolean logic is a mathematical system that deals with binary variables (1s and
0s) and logic operations such as AND, OR, and NOT. It forms the foundation of computer logic by
defining how binary values can be combined and manipulated to produce desired outcomes.

2. Truth Tables Truth tables are used to show or describe the function of a logic gate. If you are
unsure about truth tables and need guidance on how go about drawing them for individual gates or
logic circuits then use the truth table

3. Circuits: refers to the interconnected arrangement of logic gates that work together to perform
specific operation.

1 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

4. Digital Systems: Digital systems are collections of interconnected circuits that work together to
perform complex tasks. They can range from simple devices like calculators to sophisticated
computer systems.

2 Logic Gates

Logic gates are the basic building blocks of a digital circuits, each logic gate performs a specific
Boolean logic opeartion. It takes a number of inputs and has a number of outputs. Logic gates are
used to express Boolean logic expressions which mean they deal only with Boolean inputs and
outputs i.e. an input or output value can only be 0 or 1.

Types of Logic Gate

 AND gate

An AND gate is a type of digital logic device that performs a logical operation on two inputs.
The output of an AND gate is only TRUE (1) when ALL of its inputs are TRUE (1). If any of
the inputs are FALSE (0), then the output is FALSE (0) as well. An AND gate can be used to
implement logical multiplication, which means that the output is 1 only when both inputs are 1.

The diagram below represented an AND gate symbol.

Figure 1. AND gate

It has two inputs, A and B, and one output X. It works in a similar way to the English word
‘and’. For example, consider the following four responses to the question, “Did Mary and Musa
go to the school yesterday.

1. “No, neither of them went.”


2. “No, only Musa went.”
3. “No, only Mary went.”
4. “Yes, both Mary and Musa went.”

Here, we could design our English sentences using the logic gate if we map the inputs and
outputs being 0 or 1 to specific outcomes. So, if A is 0, that means Mary did not go to school
yesterday. If A is 1, that means Mary did go to the school yesterday. The same rules apply for B.
The output value X, of A AND B, is 1 if both Mary and Musa went to the school yesterday,
otherwise it’s 0. Writing this down purely as zeros and ones, is called a truth table

2 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

AND Gate Truth Table

A B X
0 0 0
0 1 0
1 0 0
1 1 1

 OR gate (Inclusive OR)

An OR gate is a type of digital logic that performs a logical operation on two inputs. The output
of an OR gate is only TRUE (1) when EITHER of its inputs are TRUE (1). If any of the inputs
are TRUE (1), then the output is TRUE (1) as well. An OR gate can be used to implement logical
addition, which means that the output is 1 when one inputs are 1.

The diagram below represented an OR gate symbol.

Figure 2. OR gate

Its structure is identical to the AND gate. It takes two binary inputs A and B, and has one binary
output X. It also corresponds to the English word ‘or’. Consider these four responses to the
question, “Would you like Fura or Soft drink?

1. “No, I don't like neither.”


2. “Yes, I would like soft drink.”
3. “Yes, I would like Fura.”
4. “Yes, I would like both.”

OR Gate Truth Table


A B X
0 0 0
1 0 1
0 1 1
1 1 1

3 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

 XOR gate (Exclusive OR)

Generally speaking, when someone asks you an ‘or’-like question, they only expect three
outcomes: the first option, the second, or neither – it rarely means both options.

There exists a logic gate that can model what is generally meant when the word ‘or’ is used in
English sentences. This logic gate is called XOR and is pronounced “ex-or” and is short for
exclusive or. Consider the responses to the question “Would you like Fura XOR Soft drink?”

Essentially it means you can exclusively have one option or the other but not both.

1. “No, I would like neither.”


2. “Yes, I would like soft drink.”
3. “Yes, I would like Fura.”
4. “No, I’d actually like both, please. If it’s not too greedy.”

Figure 3. XOR gate

XOR Gate Truth Table

A B X
0 0 0
1 0 1
0 1 1
1 1 0

 NOT gate

The NOT gate is an electronic gate that produces an inverted (opposite) version of the input at its output.
It is also known as an inverter. If the input variable is A, the inverted output is known as NOT A.

4 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

Figure 4. NOT gate

NOT Gate Truth Table


A X
0 1
1 0

 NAND gate (NOT- AND)

This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all
NAND gate are TRUE if any of the inputs are FALSE. The symbol is an AND gate with a small circle
on the output. The small circle represents inversion.

Figure 5. NAND gate

NAND Gate Truth Table

A B Y
0 0 1
0 1 1
1 0 1
1 1 0

 NOR gate (NOT-OR)

This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR
gates are FALSE, if any of the inputs are TRUE. The symbol is an OR gate with a small circle on the
output. The small circle represents inversion.

5 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

Figure 6. NOR gate

NOR Gate Truth Table


A B X
0 0 1
1 0 0
0 1 0
1 1 0

3. Concept of a Simple Comparator

 Introduction to a simple comparator circuit

Comparator is a combinational circuit that compares two digital or binary numbers in order to
find out whether one binary number is equal, less than or greater than the other binary number. We
logically design a circuit for which we will have two inputs one for A and other for B and have three
output terminals, one for A > B condition, one for A = B condition and one for A < B condition.

Figure 7. Simple comparator

 Logical design and implementation of a simple comparator

In this note, we will make different types of comparators using digital logic gates. We will begin by
designing a simple 1-bit and 2-bit comparators. The circuit for a 4-bit comparator will get slightly more
complex.

6 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

 1-bit comparator:

A 1-bit comparator is called a single bit comparator. It consists of two inputs each with single bit
number and three outputs to generate less than, equal to and greater than between two binary numbers.
The truth table for a 1-bit comparator is given below:

1-Bit comparator truth table


A B A<B A=B A>B
0 0 0 1 0
0 1 1 0 0
1 0 0 0 1
1 1 0 1 0

Let’s apply a shortcut to find the equations for each of the cases. Normally, we can use a K-map. But
this shortcut is efficient and handy when you understand it. For A>B, there is only one case when the
output is high when A=1 and B=0. We can write the equations as follows
A < B : A'.B
A = B : A'.B' + A.B
A > B : A.B'
By using these above expressions, we can implement a logic circuit for this comparator as given below:

Figure 8. 1 -bit comparator

4. Application of Computer Logic Gate

 Practical applications of logic gates in digital systems and electronic devices


 Arithmetic operations using logic gates

7 Computer Science Dept. Jigawa State College of Education, Gumel


CSC211: Introduction to Computer Logic 2024

JIGAWA STATE COLLEGE OF EDUCATION, GUMEL


School of Secondary Education (Sciences)
Department of Computer Science
CSC211:- Introductions to Computer Logic
Assignment

Instructions:- Answer any Two (2) Questions. Submission Date: 20th December, 2024

1. (a) Make a high quality research on internet and write on any Three (3)
Practical applications of logic gates in digital systems and electronic devices
2. With two examples on each operation (i.e. Addition and multiplication), How can
we use logic gates be used to perform arithmetic operations such as addition and
multiplication?
3. Draw a circuit diagram of the function given below:

I. (X . Y) + Z
II. !X + (!Y + Z)
III. !(X + Y) . Z

8 Computer Science Dept. Jigawa State College of Education, Gumel

You might also like