0% found this document useful (0 votes)
20 views37 pages

Logic Circuits 1

Logic gates are fundamental components of digital circuits, regulating electrical flow and categorized into simple types: AND, OR, and NOT gates. Each gate has specific output rules based on input values, represented through symbols, truth tables, and logic equations. Additionally, complex gates like NAND and NOR are derived from simple gates and serve as universal gates in digital electronics.

Uploaded by

sport84man
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)
20 views37 pages

Logic Circuits 1

Logic gates are fundamental components of digital circuits, regulating electrical flow and categorized into simple types: AND, OR, and NOT gates. Each gate has specific output rules based on input values, represented through symbols, truth tables, and logic equations. Additionally, complex gates like NAND and NOR are derived from simple gates and serve as universal gates in digital electronics.

Uploaded by

sport84man
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/ 37

Logic Circuits 1

What are logic gates?

Logic gates are the basic building blocks of digital circuits. Circuits are collection of
transistors and resistors. Logic gates can be defined as a type of circuit that regulates the
flow of electricity.

Types of Logic Gates:

There are three basic types of logic gates called simple gates. They include:

(1) AND
(2) OR, and
(3) NOT

AND Gate: The AND gate is a logic gate that gives an output of logic 1 only when all of its
inputs are 1. The output is usually 0 whenever at least one of the input is 0.

Mathematically, AND gate means multiplication i.e. if we have two inputs P and Q equal to
an output R, this means R = P. Q or R = P x Q

Example 1:

If P = 1 and Q = 1

P AND Q = 1 x 1 = 1

Example 2:

If P = 1 and Q = O

P AND Q = 1 x 0 = 0

OR Gate

The OR gate is logic gate that gives an output of logic 1 if either or both of the inputs is 1.
The output is usually 0 whenever at both inputs are 0. Mathematically, OR gate means
addition i.e. if we have two inputs P and Q equal to an output R, this means R = P + Q.

Example 1:

If P = 1 and Q = 1

1
P OR Q = 1 + 1 = 1

Example 2:

If P = 1 and Q = 0

P OR Q = 1 + 0 = 1

Example 3:

IF P = 0 and Q = 0

P OR Q = 0 + 0 = 0

NOT Gate (Inverter)

The NOT gate is also known as an inverter. It is a logic gate that gives a reversed output of
its given input. A NOT gate can only have one input. In mathematics, a NOT gate is seen for
examples as Output R = P.

Example 1:

If P = 0

NOT P = 1

Example 2:

If P = 1

NOT P = 0

That is an inverse of the input P gives an output R.

Logic Gate Representation

Logic gates are represented in a number of ways such as:

 Logic gate symbols


 Truth tables, and
 Logic equation

Logic Gate Symbols:

2
Logic gates have symbols that distinguish them; these symbols are referred t as Logic gate
symbols.

There are basically two types of symbols for logic gates.

(1) The traditional symbols: They are well recognized symbols and widely used in
industries and education. The traditional logic gates symbols are shown below:

Input output

P R

Input 2

Traditional AND Logic Gate Symbol

Input 1 output

P R

Input 2
Q

Traditional OR Logic Gates Symbol

Input
P R

Traditional NOT Logic Gate Symbols


2. THE IEC (International Electro-technical Commission) Symbols: They are rectangles with
a symbol inside which shows the gate function, although they are not commonly used.

& IEC AND Symbol

≥1

IEC OR Symbol

=1 IEC NOT Symbol

3
Note:
The small circle on the logic symbol is used in digital circuit diagrams to indicate an inverted
input or output.
Input and output signals of Logic Gates.
All logic gates have two types of signals namely:
(1) High signal which is represented as 1, and
(2) How signal which is represented as 0
The logic gates generate their output signals based on these signals as well as the type of
the logic gate used.
1. AND Gate
Example 1:
If P = 1 and Q = 1
P AND Q = 1 x 1 =1
1
1
1
Example 2:
If P = 1 and Q = 0
P AND Q = 1 x 0 = 0
1
0
1

Example 3”
IF P = 0 and Q = 1
P AND Q = 0 x 1 = 0
0
0
1
Example 4:
IF P = 0 and Q = 0
P AND Q = 0 x 0 = 0
0
0
0

4
2. OR Gate
Example 1:
If P = 1 and Q = 1
P OR Q = 1 + 1 = 1

1
1

Example 2:
If P = 1 and Q = 0
P OR Q = 1 + 0 = 1

1
0
Example 3:
If P = 0 and Q = 1
P OR Q = 0 + 1 = 1

1
0

Example 4:
If P = 0 and Q = 0
P OR Q = 0 + 0

1
0

5
3. NOT Gate
Example 1:
If P = 1
NOT P = 0

1 0

Example 2:
If P = 0
NOT P = 1

0 1

Truth Tables:
A truth table is a table that describes the behavior and functions of a logic gate it is a
table that contains the lists of the value of the output for every combination of logic
inputs.
The truth tables for the AND, OR and NOT logic gates are shown in the following tables:
Input P Input Q P AND Q = Output R
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table for AND Logic gate

Input P Input Q P OR Q = Output R


0 0 0
0 1 1
1 0 1
1 1 1
Truth Table for OR Logic gate

6
Input P NOT P = Output R
0 1
1 0
Truth Table for NOT Logic Gate

Logic Equations
Another form of representing logic gates apart from logic gate symbols and truth tables
is the use of logic equations. In logic equation, every input and output Boolean variable
is represented using Alphabetic letters such as A, B, C, … P, Q, R and so on). The input
alphabetic letters are connected using logic operations such as (AND, OR and NOT) or
with their respective logical symbols (^, V and ~) Logic equations for logic gates are
equations of the form:
1. For AND Logic gates
P AND Q = R or
P^Q =R
2. For logic gates OR
P OR Q = R, P V Q = R
3. For NOT logic gates:
NOT P = R, or
~P=R
Uses of Logic Gates
Logic gates are widely used in various applications such as:
Electronics:
Logic gates are in fact building blocks of digital electronics, they are formed by combining
transistors, to realize some digital operations like logical OR, AND, NOT. Every digital
products such as computers, mobile phones, calculators and even digital watches contain
logic gates.
Decision Making
The term logic is usually used to refer to a decision making process. A logic gate is a circuit
that can decide to say yes or no as output based on inputs they get.
Alarms
Logic gates are used to construct alarms used in cars and homes. When the alarm button in
front of a house is depressed, the output in front of a house is depressed; the output is a
logical 1 (i.e. on, true or high signals) which send sound signals to the person inside the
house informing him of the presence of someone.

7
Description of Alternative Logic Gates
Apart from the simple logic gates we treated earlier, we also have the complex logic gates
these includes: XOR (Exclusive OR), NAND (Not AND), NOR (Not OR) and XNOR (Exclusive
Not OR). Among these complex gates, we also have the alternative gates. The alternative
gates form the pillar of logic in that, other gates such as AND, NOT, OR, XOR and XNOR can
be created from their simple network. They are also called the Universal gates.
The two alternative logic gates we have are:
1. NAND, and
2. NOR
Types of Alternative Logic Gates
NAND Gate
The NAND gate is an AND gate with a reversed or inverted output. The logic gate gives an
output of logic 1 or true only when the output of both inputs P and Q is logic – 0 or false.
The output is usually 0 or false whenever the output of both inputs P AND Q is logic – 1.
Mathematically, NAND gate means reverse multiplication i.e. if we have two inputs P NAND
Q equal to an output R, this means
R = NOT (P AND Q).
Example 1:
If P = 1 and Q = 1
P AND Q = 1 x 1 = 1
NOT (P AND Q) = 0
Example 2:
If P = 1 and Q = 0
P AND Q = 1 x 0 = 0
NOT (P AND Q) – 1
NOR Gate
The NOR gate is an OR gate with a reversed or inverted output. The logic gate gives an
output of logic 1 or true only when the output of both inputs P OR Q is logic 0 or false. The
output is usually 0 or false whenever the output of both inputs P OR Q is logic – 1.
Mathematically, NOR gate means an inverted addition i.e. if we have two inputs P NOR Q
equal to an output R, this means
R = NOT (P OR Q).
Example 1:
If P = 1 and Q = 1
P OR Q = 1 + 1 = 1

8
NOT (P OR Q) = 0
Example 2:
IF P = 0 and Q = 0
P OR Q = 0 + 0 = 0
NOT (P OR Q) = 1
Representation of Alternative Logic gates
The alternative logic gates can also be represented as:
 Logic gate symbols
 Truth tables, and
 Logic equation.
Logic Gate Symbols
Alternative logic gates can be represented basically using the two types of the logic gate
symbols as well.
The alternative logic gate symbols are shown below:
Input 1 output

P R
Input 2
Q

Traditional NAND Logic Gate Symbol

&
IEC NAND Symbol

Input 1

P output
R
Input 2
Q

Traditional NOR Logic Gates Symbol

≥1
IEC NOR Symbol
Input and Output signals of Logic Gates

9
The alternative logic gates generate their output signals based on the two types of signals
(High = 1 and Low = 0) as well as the output of the corresponding simple logic gates.
1. NAND Gate
Example 1:
If P = 1 and Q = 1
P AND Q = 1 x 1 = 1
1
0
1

Example 2:
If P = 1 and Q = 0
P AND Q = 1 x 0 =0
P NAND Q = 1
1
1
0
Example 2:
If P = 0 and Q = 1
P AND Q = 0 x 1 = 0
P NAND Q = 1

0
1
1

Example 4:
If P = 0 and Q = 0
P AND Q = 0 x 0 = 0
P NAND Q = 1

0
1
0

10
Description of Alternative Logic Gates
Apart from the simple logic gates we treated earlier, we also have the complex logic gates
these includes: XOR (Exclusive OR), NAND (Not AND), NOR (Not OR) and XNOR (exclusive
NOT OR). Among these complex gates, we also have the alternative gates. The alternative
gates form the pillar of logic in that, other gates such as AND, NOT, OR, XOR and XNOR can
be created from their simple network. Theya re also called the Universal Gates.
The two alternative logic gates we have are:
1. NAND, and
2. NOR
Types of Alternative Logic Gates
NAND Gate
The NAND gate is an AND gate with a reversed or inverted output. The logic gate gives an
output of logic 1 or true only when the output of both inputs P AND Q is a logic – 0 or false.
The output is usually 0 or false whenever the output of both inputs P AND Q is logic – 1.
Mathematically, NAND gate means reverse multiplication i.e. if we have two inputs P NAND
Q equal to an output R, this means.
R = NOT (P AND Q).
Example 1:
IF P = 1 and Q = 1
P AND Q = 1 x 1 = 1
NOT (P AND Q) = 0
Example 2:
If P = 1 and Q 0
P AND Q = 1 x 0 = 0
NOT (P AND Q) = 1
NOR Gate
The NOR gate is an OR gate with a reverse or inverted output. The logic gate gives an
output of logic 1 or true only when the output of both inputs P OR Q is logic – 0 or false.
The output is usually 0 or false whenever the output of both inputs P OR Q is logic – 1.
Mathematically, NOR gate means an inverted addition i.e. if we have two inputs P NOR Q
equal to an output R, this means
R = NOT (P OR Q).
Example 1:
If P =1 and Q = 1
P OR Q = 1 + 1 = 1

11
NOT (P OR Q) = 0
Example 2:
If P = 0 and Q = 0
P OR Q = 0 + 0 = 0
NOT (P OR Q) = 1
Representation of Alternative Logic Gates
The Alternative logic gates can also be represented as:
- Logic gate symbols
- Truth tables, and
- Logic equations
Logic Gate Symbols
Alternative logic gates can be represented basically using the two types of the logic gate
symbols as well.
The alternative logic gate symbols are shown below:
Input 1
P
Output
Input 2 R
Q

Traditional NAND Logic Gate Symbol

&
IEC NAND Symbol

Input 1
P
Output
Input 2 R
Q
Traditional NOR Logic Gate Symbol

≥1
IEC NOR Symbol
Input and output signals of logic Gates

12
The alternative logic gates generate their output signals based on the two types of signals
(High = 1 and Low = 0) as well as the output of the corresponding simple logic gates.
1. NAND Gate
Example 1:
If P = 1 and Q = 1
P AND Q = 1 x 1 = 1
1
0
1
Example 2:
If P = 1 and Q = 0
P AND Q = 1 x 0 = 0
P NAND Q = 1
1
1
0
Example 3:
If P = 0 and Q = 1
P AND Q = 0 x 1 = 0
P NAND Q = 1
1
1
1
Example 4:
If P = 0 and Q = 0
P AND Q = 0 x 0 = 0
P NAND Q = 1
1
0
0
1. Nor gate
Example 1.
If p = 1 and Q = 1
P OR Q = 1 + 1 = 1

Example 2:

13
If P = 2 and Q = 0
P OR Q = 1 + 1 = 1
P NOR Q = 0
Example 3:
If P = 0 and Q = 0
P OR Q = 0 + 0 = 0
P NOR Q = 1
Truth tables
The truth tables for the alternative logic gates can be constructed from the simple
logic gates as shown below:
INPUT P INPUT Q P NAND Q = OUTPUT R
0 0 1
0 1 1
1 0 1
1 1 0
Truth table for NAND logic gate
INPUT P IN P NOR Q = OUTPUT R
PUT Q
0 0 1
0 1 0
1 0 0
1 1 0
Truth table for NOR logic gate

When you get the outcome of the corresponding simple logic gates, you invert the
outputs on each row to get alternative gate outputs.
Logic equations
The alphabetic letters of the inputs of alternative logic gatesa are connected using
logic operations such as NAND and NOR or with a bar across the respective logical
symbols for their corresponding simple logic gates. Logic equations for alternative
logic gates are:

1. For NAND logic gates


P NAND Q = R, or
(PɅQ) = R

14
use of alternative logic gates
Apart from the general uses of logic gates, the alternative logic gates have a
special application in flash memory
Flash memory
Flash memory is a type of non-volatile memory allocation. The technology is common
with flash drives. The most commonly used flash memories are the NOR flash and
NAND flash.
Digital comparator
Digital comparator is a very useful application of logic circuit. They are made from
logic gates XOR, NOR, NOT, AND etc. they compare the digital signals of their inputs
and produce output depending upon the condition of those inputs. For example, we
can have a digital comparator that checks. If the value of input signal of P is greater,
less than or equal to the input signal PQ.
Consider a simple comparator using XOR gate below. The output of the gate is 0 if
the inputs are the same and 1, if they differ. The truth table and logic gate symbol
for XOR comparator is shown below:
INPUT P INPUT Q P NOR Q = OUTPUT R
0 0 0
0 1 1
1 0 1
1 1 0
Truth table for XOR logic gate
XOR comparator
The output of the comparator is 1 because all the input signals to the final XOR gate are not
equal.

15
Definition of terms
Register this is a special high-speed storage area within the CPU, all data must be
represented in a register before it can be processed. For example, if two numbers are to be
multiplied, both numbers must be in registers, and the result is also placed in a register. The
register can contain the address of a memory location where data is stored rather than the
actual data itself).
Address
An address is used to reference a storage location in main memory. You can think of
computer memory as an array of storage boxes. Each of them has an address (a unique
number) assigned to it.
Bus. A collection of wires through which data is transmitted from one part of a computer to
another. You can think of a bus as a highway on which data travelled within a computer.
When used in reference to personal computers, the term bus usually refers to internal bus.
This is a bus that connects pall the internal computer components to the CPU and main
memory.
Types of registers
The types of registers are Memory Data Register (MDR) and Current Instruction Register
(CIR).
FUNCTIONS OF A REGISTER
MEMORY DATA REGISTER (MDR)
 The memory data register is used to hold data or the memory address that contains
either the next piece of data or an instruction that is to be used.
 The memory data register acts like a buffer and holds data that is transferred from
the memory to the processor.
 The memory data register is used whenever data is being transferred between
central processing unit and main memory.

Current instructions register (CIR)


 Current instruction register (CIR) is the register usually in the control unit, that
contains the instruction that is being executed by the CPU.
 The Current Instruction Register (CIR) stores the instruction currently being
executed in simple processors each instruction to be executed is loaded into the
instruction register which holds it while it is decoded, prepared and ultimately
executed.
Differences between register and main memory

16
Register are temporary storage in the CPU that hold the data the processor is currently
working on, while main memory also known as RAM holds the programme instructions and
the data the program requires.
The register are located in the processor, instead of in RAM so data can be accessed and
stored faster. Main memory is that storage that is directly accessible by the CPU and has the
capacity to allow data to be read and written.
Data-fetch-execute cycle
Fetch execute cycle is the very basic way a computer works. All commands are executed
through the running of this cycle. The cycle itself has very few commands, however when
linked up together it is possible to create a large program or even an operating system.
As soon as a computer is powered on it begins the process of the fetch-execute cycle. This
cycle is how from the beginning of the PC startup the computer is run.
The cycle contains 3 main parts.
1. Fetch the instruction
The next instruction is fetched from the memory address that is currently stored in
the prgramme counter (PC) and stored in the instruction register (IR). At the end of
the fetch operation, the PC points to the next instruction that will be read at the next
cycle.
2. Decode the instruction
The decoder interprets the instruction. During this cycle the instruction inside the IR
(instruction register) gets decoded. In case of a memory instruction (direct or
indirect) the execution phase will be in the next clock pulse.

Execute the instruction


The Control Unit of CPU passes the decoded information as a sequence of control
signals to the relevant function units of the CPU to perform the actions required by
the instruction such as reading values from registers, passing them to the ALU to
perform mathematical or logic functions on them, and writing the result back to a
register. If the ALU is involved, it sends a condition signal back to the CU.

Operating Procedure of Computer


Data Processing
Data processing consists of all activities which are necessary tc) transform data into
information. The various functions and activities which need to be performed for operating

17
procedure of computer data processing can be grouped under five basic categories as
shown below:

Collection Conversion Manipulation Storage

Operating Procedure of Computer Data


Processing
Communication
(a) Collection
Data originates in the form of events transaction or some observations. This data is then
recorded in some usable form. Data may be initially recorded on paper source documents
and then converted into a machine usable form for processing. Alternatively, they may be
recorded bfy a direct input device in a paperless machine-readable form.
(b) Conversion
Once the data is collected, it is converted from its source documents to a form that is more
suitable for processing. The data is first codified by assigning identification codes. A code
comprises of numbers, letters, special characters, or a combination of these, it is useful to
codify data, when data requires classification. To classify means to categorize, i.e., data with
similar characteristics are placed in similar categories or groups.
(C) Manipulation
Once data is collected and converted, it is ready for the manipulation function which
converts data into information. Manipulation consists of following activities:
Sorting
It involves the arrangement of data items in a desired sequence. Usually, it is easier to work
with data if it is arranged in a logical sequence. Most often, the data are arranged in
alphabetical sequence. Sometimes sorting itself will transform data into information. For
example, a simple act of sorting the names in alphabetical order gives meaning to a
telephone directory. The directory will be practically worthless without sorting.
Calculating
Arithmetic manipulation of data is called calculating. Items of recorded data can be added to
one another, subtracted, divided or multiplied to create information. Calculation is an
integral part of data processing.

Summarizing
To summarize is to condense or reduce masses of data to a more usable and concise form.
When the data involved is numbers, you summarize by accumulating the totals of the data

18
in a classification or by selecting strategic data from the mass of data being processed. For
example, the summarizing activity may provide a general manager with sales-totals by
major product line, the sales manager with sales totals by individual salesman as well as by
the product line and a salesman with sales data by customer as well as by product line.
Comparing
To compare data is to perform an evaluation in relation to some known measure. For
example, business managers compare data to discover how well their companies are doing.
They many compare current sales figures with those for last year to analyze the
performance of the company in the current month.
(d) Managing the Output Results
Once data has been captured and processed the following activities may be carried out:
Storing
To store is to hold data for continued or later use. Storage is essential for any organized
method of processing and re-using data. The storage mechanisms for data processing
systems are massive secondary storage systems like magnetic disks/magnetic tapes, DVD,
CD etc. This data are backed up and kept in a safe place.
Retrieving
To retrieve means to1 recover or find again the stored data or information. Retrieval
techniques use data storage devices. This will mainly involve retrieving data from the
backup medium.
(a) Communication
Communication is the process of sharing information. Unless the information is made
available to the users who need it, it is worthless. Thus, communication involves the transfer
of data and information produced by the data processing system to the prospective users of
such information or to another data processing system.
(b) Reproduction
To reproduce is to copy or duplicate data or information. Documents and reports can be
reproduced.
Factors affecting Speed of Data Transfer
The term data transfer refers to the amount of digital information that moves from one
computer to a device or another computer within a given period of time. The factors that
affect the speed of data transfer are:
Bus Speed
The bigger the data bus, the more data can be fetched at once and processed, making the
computer faster.

19
Bus Width
Bus width refers to how many bits of information the RAM can send to the CPU at the same
time.

Medium of storage
Different storage medium have different data transfer speed
Data transfer medium
Different data transfer medium have different transfer rates.

2nd Term
Definition of some terms:
 Computer files
 Record
 Field
 Data item

Computer files
Computer files are the most basic unit of data that users can store on a disk. Every program,
image, video, song, and document is stored as a file.
Record
A record is a collection of related data items or fields. Each record normally corresponds to a
specific unit of information. For example, employee number, employee's name,, basic salary
and house rent allowance.
Field
Data items are physically arranged as fields in a computer file. Their -length may be fixed or
variable, Since all individuals have 3 digit employee numbers, a 3-digit field is required to
store the particular data. Hence, it is a fixed field. In contrast, since customer's name vary
considerably from one customer to another, a variable amount of space must be available to
store this element. This can be called variable field.
Data item
Data item is the smallest unit of information stored in computer file. It is a single element
used to represent a fact such as an employee's name, item price, etc.
Types of Data items
Numeric

20
This type of data item consists of numbers 0 - 9 .
Alphabet
This type of data item consists of letters A-Z.
Alphanumeric
Alphanumeric (sometimes shortened to alphamerical) is a combination of alphabetic and
numeric characters and is used to describe the collection of Latin letters and Arabic digits or
a text constructed from this collection. There are either 36 (single case) or 62 (case-
sensitive) alphanumeric characters. The alphanumeric character set consists of the numbers
0- 9 and letters A-Z.
File Structure

Data

Field

Record

File

21
Represented above is the structure of a file in a systematic order from top to bottom.
Data
A data item is the smallest unit of information stored in computer file.
Field
A field is a collection of related data items.
Record
A record is a collection of related fields.
File
The collection of records is called a file.
Types of File Organization method
Serial
A serial file is one in which the records have
been stored in the order in which they have arisen. They have not been sorted into any
particular order. An example of a serial file is an unsorted transaction file, A shopping list is
an example of a non-computerized serial file. Serial files can be stored on tape, disc or in
memory.
Sequential
In a sequential file organization, records are organized in the sequence by which they were
added. A sequential file contains records organized in the order they were entered, The
order of the records is fixed. Records in these files can only be read or written sequentially.

Indexed
An indexed file organization contains reference numbers, like employee numbers, that
identify a record in relation to other records. These references are called the primary keys
that are unique to a particular record. Alternate keys can also be defined to allow.

Random file
This is a file organized via an index. Also called a "direct file" or a "direct access file," it
enables quick access to specific records or other elements within the file rather than having
to read the file sequentially. The index points to a specific location within the file, and the
file is read from that point.
Methods of accessing files
Serial files
Let us use the tape for instance, the only way to access a serially organized file is serially.

Sequential files

22
The method of access used is still SERIAL but of course the files are now in sequence, and
for this reason the term SEQUENTIAL is often used in describing serial access of a sequential
tape file, It is important to note that to process (e.g. update) a sequential master tape file,
the transaction file must also be in the sequence of the master file. Access is achieved by
first reading the transaction file and then reading the master file until the matching record
(using the record keys) is found. Note therefore that if the record required is the twentieth
record on the file, in order to get it into storage to process it the computer will first have to
read in all nineteen preceding records.

Random files
Generally speaking the method of accessing random files is RANDOM. The transaction
record keys will be put through the same mathematical formula as were the keys of the
master records, thus creating the appropriate bucket address. The transactions in random.
order are then processed against the master file, the bucket address providing the address
of record required.
6.6 Computer file Classification

Master file
There are files of a fairly permanent nature, e.g. customer ledger, payroll, inventory, etc. A
feature to know is the regular updating of these files to show a current position. For
example customer's order will be processed, increasing the "balance owing" figure on a
customer ledger record. It is seen therefore that master records will contain both data of a
static nature, e.g. a customer name, address, and data that, by its nature will change each
time a transaction occurs, e.g. the "balance" figure already mentioned.

Transaction file
This is also known as movement file. This is made up of various transactions created from
the source documents. In a sales ledger application the fiie will contain all the orders
received at a particular time. This file will be used to update the masterfile. As soon as it
had been used for this purpose it is no longer required. It will therefore have a very short
life, because it will be replace by a file containing the next batch of orders.

Reference riles
A file with a reasonable amount of permanency, Examples of data used for reference
purposes are price lists, tables of rates of pay, names and addresses.

Criteria for classifying computer files Criteria for classifying computer files are:

23
 By nature of content: it refers to the nature of file content.
 By organization method: it refers to the ,way files are arranged e.g. Serial,
sequential, random etc.
 By Storage medium: it refers to storage devices in which a file's could only be
stored such as magnetic or optical disk And magnetic tape etc

Operations of Computer Files


Create: Creating a file with a given name.
Delete: Deleting a file that are unwanted.
Retrieve: Retrieving a stored file or lose file.
Copy: Copying a created file to either an external or in-built storage device.
View: Viewing a created file or granting privilege of viewing.
Open: Opening a file to use its contents.
Update: Reading or updating the contents.
Close: Closing the file, thereby losing access until it is opened again

Describe File insecurity


Computer file insecurity refers to the concept that a computer system is vulnerable to attack,
and that this fact creates a constant battle between those looking to improve security, and
those looking to circumvent security.

Effect of insecurity of Files


Data loss refers to the unforeseen loss of data or information. An occurrence of data loss
can be called a Data Loss Event and there are several possible root causes. Backup and
recovery schemes are developed to restore lost data.

Overwriting is a process of writing a binary set of data on a memory. Overwriting


generally occurs when unused file system clusters are written upon with new data. In
general it writes over the previous data.

Methods for Files Security Backup


Backup or the process of hacking up a file refers to making copies of files so that these
additional copies may be used to restore the original after a data loss event.

Backups have two distinct purposes. The primary purpose is to recover data as a reaction to
data loss, be it by data deletion or corrupted data. The secondary purpose of backups is to

24
recover data from a historical period of time within the constraints of a user-defined data
retention policy.

Antivirus
An anti-virus program protects a computer file from malicious viruses’ attack, detects
and heals files that have been attacked. Usually L consists of a firewall, a virus scanner and
remover, and sometimes other tools as well.

Password
it is a user chosen secret string of characters that allows access to a computer, interface,
files, etc. The use of password is at user's discretion and caution must be exercised by the
user to remember the password always.

Differences between computer files arid manual files


 Manual is using old method without the help of the technology or maybe less to
perform certain task or work. For example, using type writer to write a-report or
keep documents in the paper folder. While computerized file system is using latest
technology of ICT to carry out various tasks that is more effective when compared
with manual system in terms of the productivity and time usage.

Manual files are subject to physical damages thus may not be very accurate, but computer
files are consistently reliable.
Advantages of computer files over manual files
 Faster and efficient in processing of information unlike manual files.
• More timely information can be produced with computer file while manual files
information is not timely. «.
 ® Many types of useful reports can be generated for management from computer
files to make decisions.
 A computer file takes less space, is up- to date but a manual file system takes
lots of spaces and is difficult to find.
 » Accurate information and faster decision making while manual database is like a
filing cabinet, slow and clumsy, and you can lose records.

25
Definition of terms - Register this is a special high-speed storage area within the CPU, all
data must be represented in a register before it can be processed. For example, if two
numbers are to be multiplied, both numbers must be in registers, and the result is also
placed in a register.
Address
An address is used to reference a storage location in main memory. You can think of
computer memory as an array of storage boxes. Each of them has an address (a unique
number) assigned to it.
Bus. A collection of wires through which data is transmitted from one part of a computer to
another. You can think of a bus as a highway on which data travelled within a computer.
Types of registers
The types of registers are Memory Data Register (MDR) and Current Instruction Register
(CIR).

FUNCTIONS OF A REGISTER
MEMORY DATA REGISTER (MDR)
 The memory data register is used to hold data or an instruction that is to be used.
 The memory data register holds data that is transferred from the memory to the
processor.
 The memory data register is used whenever data is being transferred between
central processing unit and main memory.
Current instructions register (CIR)
 Current instruction register (CIR) is the register usually in the control unit that
contains the instruction that is being executed by the CPU.
 The Current Instruction Register (CIR) stores the instruction currently being
executed in simple processors each instruction to be executed is loaded into the
instruction register which holds it while it is decoded, prepared and ultimately
executed.

Differences between register and main memory


Register are temporary storage in the CPU that hold the data the processor is currently
working on, while main memory also known as RAM holds the program instructions and the
data the program requires.

26
The register is located in the processor, instead of in RAM so data can be accessed and
stored faster. Main memory is that storage that is directly accessible by the CPU and has the
capacity to allow data to be read and written.
Data-fetch-execute cycle
Fetch execute cycle is the very basic way a computer works. All commands are executed
through the running of this cycle.
As soon as a computer is powered on it begins the process of the fetch-execute cycle. This
cycle is how from the beginning of the PC startup the computer is run.

The cycle contains 3 main parts.


1. Fetch the instruction
The next instruction is fetched from the memory address that is currently stored in
the program counter (PC) and stored in the instruction register (IR). At the end of
the fetch operation, the PC points to the next instruction that will be read at the next
cycle.

2. Decode the instruction


The decoder interprets the instruction. During this cycle the instruction inside the IR
(instruction register) gets decoded.
3. Execute the instruction
The Control Unit of CPU passes the decoded information as a sequence of control
signals to the relevant function units of the CPU to perform the actions required by
the instruction such as reading values from registers, passing them to the ALU to
perform mathematical or logic functions on them, and writing the result back to a
register.
Operating Procedure of Computer
Data Processing
Data processing consists of all activities which are necessary to transform data into
information. The various functions and activities which need to be performed for operating
procedure of computer data processing can be grouped under five basic categories as
shown below:

Collection Conversion Manipulation Storage


Operating Procedure of Computer Data
Processing
Communication

27
(a) Collection
Data originates in the form of events transaction or some observations. This data is then
recorded in some usable form. Data may be initially recorded on paper source documents
and then converted into a machine usable form for processing.
(b) Conversion
Once the data is collected, it is converted from its source documents to a form that is more
suitable for processing.

(C) Manipulation
Once data is collected and converted, it is ready for the manipulation function which
converts data into information. Manipulation consists of following activities:

Sorting
It involves the arrangement of data items in a desired sequence. Usually, it is easier to work
with data if it is arranged in a logical sequence. Most often, the data are arranged in
alphabetical sequence. Sometimes sorting itself will transform data into information.
Calculating
Arithmetic manipulation of data is called calculating. Items of recorded data can be added to
one another, subtracted, divided or multiplied to create information. Calculation is an
integral part of data processing.

Summarizing
To summarize is to condense or reduce masses of data to a more usable and concise form.
Comparing
To compare data is to perform an evaluation in relation to some known measure. For
example, business managers compare data to discover how well their companies are doing.
They many compare current sales figures with those for last year to analyze the
performance of the company in the current month.

(d) Managing the Output Results


Once data has been captured and processed the following activities may be carried out:

Storing

28
To store is to hold data for continued or later use. The storage mechanisms for data
processing systems are massive secondary storage systems like magnetic disks/magnetic
tapes, DVD, CD etc. This data are backed up and kept in a safe place.

Retrieving
To retrieve means to1 recover or find again the stored data or information. Retrieval
techniques use data storage devices. This will mainly involve retrieving data from the
backup medium.

(c) Communication
Communication is the process of sharing information. Unless the information is made
available to the users who need it, it is worthless..

(d) Reproduction
To reproduce is to copy or duplicate data or information. Documents and reports can be
reproduced.

Factors affecting Speed of Data Transfer


The term data transfer refers to the amount of digital information that moves from one
computer to a device or another computer within a given period of time. The factors that
affect the speed of data transfer are:

Bus Speed
The bigger the data bus, the more data can be fetched at once and processed, making the
computer faster.
Bus Width
Bus width refers to how many bits of information the RAM can send to the CPU at the same
time.

Medium of storage
Different storage medium have different data transfer speed.
Data transfer medium
Different data transfer medium have different transfer rates.

Examples
4. Define a register and a bus
5. List types of register

29
6. State one function of
 NOR
 OR
7. State two differences between register and main memory
8. List factors affecting speed of data transfer.

30
Definition of some terms:
 Computer files
 Record
 Field
 Data item

Computer files
Computer files are the most basic unit of data that users can store on a disk. Every program,
image, video, song, and document is stored as a file.

Record
A record is a collection of related data items or fields. Each record normally corresponds to a
specific unit of information. For example, employee number, employee's name,, basic salary
and house rent allowance.

Field
Data items are physically arranged as fields in a computer file. Their -length may be fixed or
variable, Since all individuals have 3 digit employee numbers, a 3-digit field is required to
store the particular data. Hence, it is a fixed field.

Data item
Data item is the smallest unit of information stored in computer file. It is a single element
used to represent a fact such as an employee's name, item price, etc.
Types of Data items
Numeric
This type of data item consists of numbers 0 - 9 .
Alphabet
This type of data item consists of letters A-Z.
Alphanumeric
Alphanumeric (sometimes shortened to alphameric) is a combination of alphabetic and
numeric characters, and is used to describe the collection of Latin letters and Arabic digits or
a text constructed from this collection. There are either 36 (single case) or 62 (case-
sensitive) alphanumeric characters. The alphanumeric character set consists of the numbers
0- 9 and letters A-Z.
6,3 File Structure

31
Data

Field

Record

File

32
Represented above is the structure of a file in a systematic order from top to bottom.
Data
A data item is the smallest unit of information stored in computer file.
Field
A field is^a collection of related data items.
Record
A record is a collection of related fields.
File
The collection of records is called a file.
Types of File Organization method
Serial
A serial file is one in which the records have
been stored in the order in which they have arisen. They have not been sorted into any
particular order. An example of a serial file is an unsorted transaction file, A shopping list is an
example of a non-computerized serial file. Serial files can be stored on tape, disc or in memory.
j
Sequential
In a sequential file organization, records are organized in the sequence by which they were
added. A sequential file contains records organized in the order they were entered, The order of
the records is fixed. Records in these files can only be read or written sequentially.

Indexed
An indexed file organization contains reference numbers, like employee numbers, that identify a
record in relation to other records. These references are called the primary keys that are unique
to a particular record. Alternate keys can also be defined to allow.

Random file
This is a file organized via an index. Also called a "direct file" or a "direct access file," it enables
quick access to specific records or other elements within the file rather than having to read the
file sequentially. The index points to a specific location within the file, and the file is read from
that point.
Methods of accessing files

33
Serial files
Let us use the tape for instance, the only way to access a serially organized file is serially.

Sequential files
The method of accass used is still SERIAL but of course the files are now in sequence, and for
this reason the term SEQUENTIAL is often used in describing serial access of a sequential tape
file, It is important to note that to process (e.g update) a sequential master tape file, the
transaction file must also be in the sequence of the master file. Access is achieved by first
reading the transaction file and then reading the master file until the matching record (using
the record keys) is found. Note therefore that if the record required is the twentieth record on
the file, in order to get it into storage to process it the computer will first have to read in all
nineteen preceding records.

Random files
Generally speaking the method of accessing random files is RANDOM. The transaction record
keys will be put through the same mathematical formula as were the keys of the master records,
thus creating the appropriate bucket address. The transactions in random. order are then
processed against the master file, the bucket address providing the address of record required.
Computer file Classification

Master file
There are files of a fairly permanent nature, e.g. customer ledger, payroll, inventory, etc. A
feature to know is the regular updating of these files to show a current position. For example
customer's order will be processed, increasing the "balance owing" figure on a customer ledger
record. It is seen therefore that master records will contain both data of a static nature, e.g. a
customer name, address, and data that, by its nature will change each time a transaction
occurs, e.g. the "balance" figure already mentioned.

Transaction file
This is also known as movement file. This is made up of various transactions created from the
source documents. In a sales ledger application the fiie will contain all the orders received at a
particular time. This file will be used to update the masterfile. As soon as it had been used for
this purpose it is no longer required. It will therefore have a very short life, because it will be
replace by a file containing the next batch of orders.

34
Reference riles
A file with a reasonable amount of permanency, Examples of data used for reference purposes
are price lists, tables of rates of pay, names and addresses.

Criteria for classifying computer files Criteria for classifying computer files are:
 By nature of content: it refers to the nature of file content.
 By organization method: it refers to the ,way files are arranged e.g. Serial, sequential,
random etc.
 By Storage medium: it refers to storage devices in which a file's could only be stored
such as magnetic or optical disk And magnetic tape etc

Operations of Computer Files


Create: Creating a file with a given name.
Delete: Deleting a file that are unwanted.
Retrieve: Retrieving a stored file or lose file.
Copy: Copying a created file to either an external or in-built storage device.
View: Viewing a created file or granting privilege of viewing.
Open: Opening a file to use its contents.
Update: Reading or updating the contents.
Close: Closing the file, thereby losing access until it is opened again

Describe File insecurity


Computer file insecurity refers to the concept that a computer system is vulnerable to attack,
and that this fact creates a constant battle between those looking to improve security, and
those looking to circu mvent security.

Effect of insecurity of Files


Data loss refers to the unforeseen loss of data or information. An occurrence of data loss can
be called a Data Loss Event and there are several possible root causes. Backup and recovery
schemes are developed to restore lost data.

35
Overwriting is a process of writing a binary set of data on a memory. Overwriting generally
occurs when unused file system clusters are written upon with new data. In general it writes
overthe previous data.

Methods for Files Security Backup


Backup or the process of hacking up a file refers to making copies of files so that these
additional copies may be used to restore the original after a data loss event.

Backups have two distinct purposes. The primary purpose is to recover data as a reaction to
data loss, be it by data deletion or corrupted data. The secondary purpose of backups is to
recover data from a historical period of time within the constraints of a user-defined data
retention policy.

Antivirus
An anti-virus program protects a computer file from malicious viruses attack, detects and
heals files that have been attacked. Usually L consists of a firewall, a virus scanner and remover,
and sometimes othertools as well.

Password
it is a user chosen secret string of characters that allows access to a computer, interface, files,
etc. The use of password is at user's discretion and caution must be exercised by the user to
remember the password always.

Differences between computer files arid manual files


 Manual is using old method without the help of the technology or maybe less to perform
certain task or work. For example using type writer to write a-report or keep documents
in the paper folder. While computerized file system is using latest technology of ICT to
carry out various tasks that is more effective when compared with manual system in
terms of the productivity and time usage.

Manual files are subject to physical damages thus may not be very accurate but computer files
are consistently reliable.
Advantages of computer files over manual files
 Faster and efficient in processing of information un|ike manual files.

36
• More timely information can be produced with computer file while manual files information
are not timely. «.
 ® Many types of useful reports can be generated for management from computer files
to make decisions.
 A computer file takes less space, is up- to date but a manual file system takes lots of
spaces and is difficult to find.
» Accurate information and faster decision making while manual database is like a filing cabinet,
slow and clumsy, and you can lose

37

You might also like