0% found this document useful (0 votes)
44 views25 pages

SIM For Week 4

This document provides an overview of machine level data representation and basic electronics concepts: 1) It defines key terms related to digital signals, data representation, and numbering systems such as analog/digital signals, bits, bytes, and binary, decimal, hexadecimal numbering systems. 2) It explains how computers represent data using binary digits (bits) and how numbers can be converted between numbering systems. 3) It provides a basic introduction to electronics concepts like electric charge, current, voltage and circuit components like batteries, wires, and switches.

Uploaded by

Gaming Hack
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)
44 views25 pages

SIM For Week 4

This document provides an overview of machine level data representation and basic electronics concepts: 1) It defines key terms related to digital signals, data representation, and numbering systems such as analog/digital signals, bits, bytes, and binary, decimal, hexadecimal numbering systems. 2) It explains how computers represent data using binary digits (bits) and how numbers can be converted between numbering systems. 3) It provides a basic introduction to electronics concepts like electric charge, current, voltage and circuit components like batteries, wires, and switches.

Uploaded by

Gaming Hack
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/ 25

Big Picture

Week 4 - 5: Unit Learning Outcomes (ULO): at the end of the unit, you are expected to:

a. Describe machine level data representation.


b. Name, explain and sketch the basic electronics.

BIG PICTURE in Focus: ULO a. Describe machine level data representation.

Metalanguage

In this section, the most essential terms relevant to the study of this course to demonstrate
the ULO a will be operationally defined to establish a common frame of reference as to how
the text work in your chosen field or career. You will encounter these terms as we go through
the study of this course.

A continuous signal in which one time-varying quantity represents


Analog Signal
another time-based variable.
A signal that is being used to represent data as a sequence of
Digital Signal
discrete values.
A systematic way to represent numbers with symbolic characters
Numbering System and uses a base value to conveniently group numbers in compact
form.
Absolute Value The magnitude of a digit in a number.
Place Value Refers to the position of the digit in that number.
Bit Holds one of two possible values, either of the binary digits 0 or 1.
Unit of digital information that most commonly consists of eight
Byte
bits.
Nibble A four-bit aggregation, or half an octet.
Boolean Function An expression formed with binary variables.
Logic Gate A building block of a digital circuit.

Essential Knowledge

Computers are classified according to functionality, physical size and purpose. Functionality,
Computers could be analog, digital or hybrid. Digital computers process data that is in
discrete form whereas analog computers process data that is continuous in nature. Hybrid
computers on the other hand can process data that is both discrete and continuous.

In digital computers, the user input is first converted and transmitted as electrical pulses that
can be represented by two unique states ON and OFF. The ON state may be represented by a
“1” and the off state by a “0”. The sequence of ON’S and OFF’S forms the electrical signals
that the computer can understand.

A digital signal rises suddenly to a peak voltage of +1 for some time then suddenly drops -1
level on the other hand an analog signal rises to +1 and then drops to -1 in a continuous
version.

Electrical signals or waveforms of this nature are said to be periodic. Generally, a periodic
wave representing a signal can be described using the following parameters: Amplitude(A),
Frequency(f), Periodic Time(T)

• Amplitude (A): this is the maximum displacement that the waveform of an electric
signal can attain.
• Frequency (f): is the number of cycles made by a signal in one second. It is measured
in hertz.1hert is equivalent to 1 cycle/second.
• Periodic time (T): the time taken by a signal to complete one cycle is called periodic
time. Periodic time is given by the formula T=1/f, where f is the frequency of the wave.

When a digital signal is to be sent over analog telephone lines e.g. e-mail, it has to be
converted to analog signal. This is done by connecting a device called a modem to the digital
computer. This process of converting a digital signal to an analog signal is known as
modulation. On the receiving end, the incoming analog signal is converted back to digital form
in a process known as demodulation.

It has proved difficult to develop devices that can understand natural language directly due
to the complexity of natural languages. However, it is easier to construct electric circuits
based on the binary or ON and OFF logic. All forms of data can be represented in binary system
format. Other reasons for the use of binary are that digital devices are more reliable, small
and use less energy as compared to analog devices.

A numbering system is a systematic way to represent numbers with symbolic characters and
uses a base value to conveniently group numbers in compact form. The most common
number system is decimal, which has a base value of 10, and a symbolic character set of 0, 1,
2, 3, 4, 5, 6, 7, 8, and 9. However, there are other number systems, and they can be more
efficient to use for a specific purpose. For example, because computers use Boolean logic to
perform calculations and operations, they use the binary number system, which has a base
value of 2.
Table of Number Systems

DECIMAL NUMBERING SYSTEMS


Most people today use decimal representation to count. In the decimal system there are 10
digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

The value is formed by the sum of each digit, multiplied by the base (in this case it
is 10 because there are 10 digits in decimal system) in power of digit position (counting from
zero). A decimal number should always be written with a subscript 10 e.g. X10.

The magnitude of a number can be considered using these parameters.


• Absolute value
• Place value or positional value
• Base value

The absolute value is the magnitude of a digit in a number. For example, the digit 5 in 7458
has an absolute value of 5 according to its value in the number line.

The place value of a digit in a number refers to the position of the digit in that number i.e.
whether; tens, hundreds, thousands etc.

The total value of a number is the sum of the place value of each digit making the number.

The base value of a number also k known as the radix, depends on the type of the number
systems that is being used. The value of any number depends on the radix. For example, the
number 10010 is not equivalent to 1002.

Example:
• 754
• 547

BINARY NUMBERING SYSTEMS


Computers are not as smart as humans are (or not yet), it's easy to make an electronic
machine with two states: on and off, or 1 and 0. Computers use binary system, it uses two
digits namely, 1 and 0 to represent numbers. Unlike in decimal numbers where the place value
goes up in factors of ten, in binary system, the place values increase by the factor of 2. Binary
numbers are written as X2. Consider a binary number such as 10112. The right most digit has
a place value of 1×20 while the left most has a place value of 1×23.

Each digit in a binary number is called a BIT, 4 bits form a NIBBLE, 8 bits form a BYTE, two
bytes form a WORD, two words form a DOUBLE WORD (rarely used).

Example:
• 10100101

HEXADECIMAL NUMBERING SYSTEMS


This is a base 16 number system that consists of sixteen digits ranging from 0-9 and letters A-
F where A is equivalent to 10, B to 11 up to F which is equivalent to 15 in base ten system.
The place value of hexadecimal numbers goes up in factors of sixteen.
A hexadecimal number can be denoted using 16 as a subscript or capital letter H to the right
of the number. For example, 94B can be written as 94B16 or 94BH.

It is very easy to convert numbers from binary system to hexadecimal system and vice-versa,
every nibble (4 bits) can be converted to a hexadecimal digit using this table:

Decimal Binary Hexadecimal


(base 10) (base 2) (base 16)
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

Example:
• 1234
Basic Electronics

The distinct values 1 or 0 as discussed above also represents positive and negative or
represented as On/Off Switch. Imagine a lamp or a bulb, it has two terminals known as anode
and cathode. The anode is positive, and cathode is negative. To light up the lamp, we need
to connect the positive terminal of the lamp to the anode terminal of the battery and the
negative terminal to the cathode terminal. A switch is connected in between wire to give
supply or voltage to the lamp. See figure below.

The connections of these positive and negative wires on a breadboard or by soldering on PCB
to form circuits are known as electrical and electronic circuits.

Electric charge or electrical charge or electrostatic charge refers to the physical property of
matter that causes it to experience a force when placed in an electromagnetic field.

2 Types of Electric Charge


1. Positive (Protons)
2. Negative (Electrons)

Electricity is the flow of electrons, so it is necessary to measure the charge.


1 coulomb is equal to the charge of 6,250,000,000,000,000,000 electrons!!!

1C = 6.25x10^18 electrons

What is Current?
• Current is represented by the letter I.
• The basic unit for measuring current is ampere.
• Ampere can be abbreviated to amp or just A.
• 1 amp = 1 coulomb/sec, meaning for every amp, there are 6.25x10^18 electrons
moving past a point every second.

What is Voltage?
• Voltage, also called electromotive force, is a quantitative expression of the potential
difference in charge between two points in an electrical field.

Analogy of Voltage

Let’s imagine that electrons are represented by a marble on a flat plane. At this point, the
plane is level, and the marble does not move. If the plane is lifted at one side, the marble will
roll down to the lower point.

In electricity
• The high point is a point with lots of electrons and the low point is a point with a lack
of electrons.
• The high point is called the high potential and the low point is the low potential.
• The difference between these two points is called the potential difference.
• The larger the potential difference, the larger the VOLTAGE.
• Voltage can be thought of as the measure of the pressure pushing the electrons. The
higher the pressure, the higher the voltage.
• Voltage is represented by the letter E. The basic unit of measure is volts or the letter
V.

What is POWER?

• Power is simply the amount of energy used or the amount of "work" a circuit is
doing.
• Power is represented by the letter P.
• The basic unit for measuring power is watts or the letter W.
• To find power, all you need is a simple equation:
P=E*I
Power = voltage * current.
• We follow the electrical power triangle (power formula) in
getting the equation.
Example: Looking at the power triangle:

• To calculate the Power, we multiply, Voltage (V) and Current (I)


P = E * I, remember that voltage is represented by E
• To calculate the Voltage, we divide Power (P) by Current (I)
E=P/I
• To calculate the Current, we divide Power (P) by Voltage (V)
I=P/E

Sample Calculations

1. Calculate the Power using the given values:


E = 9V
I = 0.5A

Power = voltage * current


= 9V * 0.5A
= 4.5 W

2. Calculate the Voltage from the given values below:

P = 100 W
I = 2.5 A

Voltage (E) = 100 W / 2.5 A


= 40V

3. Calculate the current from the given values below:

V = 12V
P = 60W

Current (I) = 60W / 12V


= 5A

What is RESISTANCE?

• Is the opposition that a substance offers to the flow of electric current.


• Blocks some electrons from going through the circuit making the battery dimmer.
• It is represented by letter R.
• The standard unit of resistance is ohm or the Greek Omega symbol (Ω).
• Ohm's law is one of the most important concepts in electronics.
• It is a simple mathematical relationship between current, voltage, and resistance.
According to the Ohm's law, voltage equals current times resistance which is expressed in
the following equation:

E = I*R

where E = voltage, I = current, and R = resistance

What is RESISTOR?

• A resistor is an electrical component that limits or regulates the flow of electrical


current in an electronic to provide a specific voltage for an active device such as a
transistor.

What do Resistors do?

• Resistors limit current. In a typical application, a resistor is connected in series with a


LED:

• The resistor can be represented by the following symbols, 'box' symbol for a fixed
resistor is popular in the UK and Europe. A 'zig-zag' symbol is used in America and
Japan:

• The color of the resistor indicates its value in terms of ohms or can be test using a
tester. It follows the color coding to get the value.
Below is an example on how to get the value of the resistor

Example 1:

• The first color is BROWN, in the color code 1st band, BROWN is 1
• The second color is BLACK, in the color code 2nd band, BLACK is 0
• The third color RED, since Resistor has only four colors, RED is considered as the
multiplier and the Gold considered as the Tolerance. In the color code, RED as
multiplier has a value of 100.

Brown,Black,Red = 10 x 100 = 1000 ohms or 1K ohms

Gold as Tolerance has a value of ± 5 %, it means that the tolerance of 1K ohms is equal to 950
ohms to 1050 ohms.
Looking at the color code, what is the value of this resistor and its tolerance value?

Resistance can be calculated in series and parallel. In a series circuit, the current flowing is
the same at all points. For example:

To calculate the resistance in series, we can use the formula:


RTotal = R1 + R2
= 1KΩ + 1KΩ
= 2K Ω

To get the voltage, we use the formula: Volage (E) = Current (I) * Resistance (RT)

Voltage = 3mA * 2K Ω
= 6V

However, if we calculate the voltage per resistance, we got

Voltage = 3mA * 1K Ω
= 3V

To calculate the Current, we will transpose the formula


Volage (E) = Current (I) * Resistance (RT)
in to
Current (I) = Voltage (E) / Resistance (RT)
= 6V / 2K Ω
= 3mA
When components are connected in parallel, the voltage across them is the same.

• The next circuit shows two resistors connected in parallel to a 6 V battery:


• To Compute for Resistance: use the PRODUCT OVER SUM FORMULA

To get the total resistance in the above circuit:

To calculate the current,

To complete the picture, the voltage across R1 and R2 can be calculated as:

What is CAPACITOR?

• A device used to store charge in an electrical circuit.


• A capacitor functions much like a battery, but charges and discharges much more
efficiently
• Capacitor electron storing ability called capacitance measured in Farads (µF).
• One Farad is a huge amount of charge, to be exact that is equal to
6,280,000,000,000,000,000 electrons
BOOLEAN ALGEBRA & LOGIC GATES

We have learned the basic electronics in the previous topics. Those concepts are important
in understanding its connections to the Boolean functions because Boolean functions are
practically implemented by using electronic gates. These Boolean functions are simplified
using the Boolean Algebra’s 1) operations and expressions, and 2) laws and rules (axioms or
postulates).

What are these important points?

• Electronic gates require a supply of power.


• Gate INPUTS are driven by voltages having two distinct values, like 0V and 5V, which
are representing logic 0 and logic 1 respectively.
• The OUTPUT of a gate provides two nominal values of voltage only, like 0V and 5V
representing logic 0 and logic 1 respectively. In general, there is only one output to a
logic gate except in some special cases.
• The OUTPUT of the gate requires a LED that serves as an On/Off Switch. This On/Off
switch must have enough voltage. If voltage is too much, it might detonate the LED.
The reason for adding resistance through a resistor, color coding is way to determine
the number of ohms to resist the number of voltages flowing.

BOOLEAN ALGEBRA & LOGIC SIMPLIFICATION

Definition: Boolean algebra, like any other deductive mathematical system, may be defined
with a set of elements, a set of operators, and several unproved axioms or postulates. A set
of elements is any collection of objects having a common property.

1) Boolean Operations and Expressions

The Variable, complement, and literal are terms used in Boolean algebra.
• A variable is a symbol used to represent a logical quantity. Any single variable can
have a 1 or a 0 value.
• The complement is the inverse of a variable and is indicated by a bar over variable
(overbar).

For example:

The complement of the variable A is A. If A = 1, then A = 0. If A = 0, then A = 1.

The complement of the variable A is read as "not A" or "A bar (Ā)."

Sometimes a prime symbol rather than an overbar is used to denote the


complement of a variable; for example, A' indicates the complement of A.

• A literal is a variable or the complement of a variable.


Boolean Addition

• In Boolean algebra, a sum term is a sum of literals. In logic circuits, a sum term is
produced by an OR operation with no AND operations involved.

• Some examples of sum terms are A + B, A + B, A + B + C, and A + B + C + D.

• A sum term is equal to 1 when one or more of the literals in the term are 1. A sum
term is equal to 0 only if each of the literals is 0.

Boolean Multiplication

• In Boolean algebra, a product term is the product of literals. In logic circuits, a product
term is produced by an AND operation with no OR operations involved.

• Some examples of product terms are AB, AB, ABC, and ABCD.

• A product term is equal to 1 only if each of the literals in the term is 1. A product term
is equal to 0 when one or more of the literals are 0.

2) Laws and Rules of Boolean Algebra

The basic laws of Boolean algebra such as the commutative laws for addition and
multiplication, the associative laws for addition and multiplication, and the distributive law-
are the same as in ordinary algebra.

BOOLEAN ALGEBRA VS ORDINARY ALGEBRA


• Huntington postulates do not include the associative law. However, this law holds for
Boolean algebra.
• The distributive law of + over × is valid for Boolean algebra but not for ordinary
algebra.
• Boolean algebra does not have additive or multiplicative inverses, \ no subtraction or
division.
• The operator complement is not available in ordinary algebra.
• Ordinary algebra deals with real numbers, Boolean algebra deals with only two
elements.

Commutative Laws - Addition

• The commutative law of addition for two variables is written as

A+B = B+A
• This law states that the order in which the variables are ORed (added) makes no
difference. Remember, in Boolean algebra as applied to logic circuits, addition and the
OR operation are the same.

Logic Gate of OR gate:

Truth Table of OR gate

Figure below illustrates the (A + B = B + A) commutative law as applied to the OR gate and
shows that it doesn't matter to which input each variable is applied. (The symbol ≡ means
"equivalent to.").

Commutative Laws - Multiplication

The commutative law of multiplication for two variables is A.B = B.A This law states that the
order in which the variables are ANDed makes no difference.

Logic Gate of AND gate:


Truth Table of AND gate

Figure below illustrates this Cumulative law of Multiplication as applied to the AND gate.

Associative Law - Addition

The associative law of addition is written as follows for three variables:

A + (B + C) = (A + B) + C

This law states that when ORing more than two variables, the result is the same regardless of
the grouping of the variables.

Associative Law – Multiplication

The associative law of multiplication is written as follows for three variables:

A(BC) = (AB)C

This law states that it makes no difference in what order the variables are grouped when
ANDing more than two variables.

Figure below illustrates this law as applied to 2-input AND gates.


Distributive Law

The distributive law is written for three variables as follows:

A(B + C) = AB + AC

This law states that ORing two or more variables and then ANDing the result with a single
variable is equivalent to ANDing the single variable with each of the two or more variables
and then ORing the products. The distributive law also expresses the process of factoring in
which the common variable A is factored out of the product terms.

For example:

AB + AC = A(B + C).

Figure below illustrates the distributive law in terms of gate.

Rules of Boolean Algebra

The basic rules that are useful in manipulating and simplifying Boolean expressions. Rules 1
through 9 will be viewed in terms of their application to logic gates. Rules 10 through 12 will
be derived in terms of the simpler rules and the laws that are previously discussed.
Rule 1: A+0=A

A variable ORed with 0 is always equal to the variable. If the input variable A is 1, the output
variable X is 1, which is equal to A. If A is 0, the output is 0, which is also equal to A. This rule
is illustrated below, where the lower input is fixed at 0.

Rule 2: A+1=1

A variable ORed with 1 is always equal to 1. A 1 on an input to an OR gate produces a 1 on the


output, regardless of the value of the variable on the other input. This rule is illustrated below,
where the lower input is fixed at 1.

Rule 3: A.0=0

A variable ANDed with 0 is always equal to 0. Any time one input to an AND gate is 0, the
output is 0, regardless of the value of the variable on the other input. This rule is illustrated
below, where the lower input is fixed at 0.

Rule 4: A.1=A

A variable ANDed with 1 is always equal to the variable. If A is 0 the output of the AND gate
is 0. If A is 1, the output of the AND gate is 1 because both inputs are now 1s. This rule is
shown below, where the lower input is fixed at 1.
Rule 5: A+A=A

A variable ORed with itself is always equal to the variable. If A is 0, then 0 + 0 = 0; and if A is
1, then 1 + 1 = 1. This is shown below where both inputs are the same variable.

Rule 6: A+Ā=1

A variable ORed with its complement is always equal to 1. If A is 0, then 0 + 0’ = 0 + 1 = 1. If A


is l, then 1 + 1’ = 1+ 0 = 1. See figure below to illustrate the A + Ā = 1 , where one input is
the complement of the other.

Logic gate of NOT gate:

Truth Table of NOT gate:

A Ā
Ā A
A+Ā=1
Rule 7: A.A=A

A variable ANDed with itself is always equal to the variable. If A = 0, then 0.0 = 0; and if A = 1.
then 1.1 = 1. Figure below illustrates this rule.

Rule 8: A.Ā=0

A variable ANDed with its complement is always equal to 0. Either A or A will always be 0: and
when a 0 is applied to the input of an AND gate. the output will be 0 also. Figure below
illustrates this rule.

Rule 9:

The double complement of a variable is always equal to the variable. If you start with the
variable A and complement (invert) it once, you get Ā. If you then take Ā and complement
(invert) it, you get A, which is the original variable. This rule is shown in Figure below using
inverters.

Rule 10: A + AB = A
This rule can be proved by applying the distributive law, rule 2, and rule 4 as follows:

A + AB = A( 1 + B) Factoring (distributive law)

=A.1 Rule 2: (1 + B) =1
=A Rule 4: A . 1 = A
The proof is shown in Table below, which shows the truth table and the resulting logic circuit
simplification.

Rule 11: A + ĀB = A + B
This rule can be proved as follows:

A + ĀB = (A + AB) + ĀB Rule 10: A = A + AB


= (AA + AB) + ĀB Rule 7: A = AA
= AA + AB + AĀ+ĀB Rule 8: adding AĀ = 0
= (A + Ā) (A + B) Factoring
= 1.(A+B) Rule 6: A + Ā = 1
=A+B Rule 4: Drop the 1

The proof is shown in the Table below, which shows the truth table and the resulting logic
circuit simplification.
Rule 12: (A + B) (A + C) = A + BC

This rule can be proved as follows:

(A + B) (A + C) = AA + AC + AB + BC Distributive Law
= A + AC + AB + BC Rule 7: AA = A
= A (1 + C) + AB + BC Rule 2: 1 + C = 1
= A.1 + AB + BC Factoring (distributive law)
= A (1 + B) + BC Rule 2: 1 + B = 1
= A.1 + BC Rule 4: A . 1 = A
= A + BC

The proof is shown in the table below, which shows the truth table and the resulting logic
circuit simplification.

Self-Help: You can refer to the sources below to help you further
understand the lesson.

• Vermaat, M., Sebok, S., Freund, S., Campbell, J., & Frydenberg, M. (2016). Discovering
Computers 2016: Tools, Apps, Devices, and the Impact to Technology. Cengage.
• https://www3.ntu.edu.sg/home/ehchua/programming/java/datarepresentation.htm
l
Let’s Check
Solve the given problems and provide a solution.

1. An online quiz asks students questions about computer science topics. One of the
colors used in an image is 'cadet blue'. 'Cadet blue' in binary is 0101 1111 1001 1110
1010 0000. Convert 0101 1111 1001 1110 1010 0000 to hexadecimal.

2. Find the value of a) resistance from the given circuit below and 2) the current
following at point B, C and D.

Let’s Analyze:

1. What resistor values are indicated by the following colour bands?

Tolerance
Resistor Color Value
Minimum Value Maximum Value
blue, black, red
grey, red, brown

2. Determine the color combination of the following resistance values

Resistor Value Color


1. 1.8 K Ohm
2. 270 Ohm
3. 56 K Ohm
4. 10 K Ohm (Three color band)
5. 10 K ohm (Four color band)

3. Simplify the given Boolean expression and draw its logic circuit simplification. Show
the Rules you’ve used in simplifying the expression.

Boolean Expression : AB + A’B + BC + BC’

In a Nutshell

Based on the definition of the most essential terms and the learning exercises that you have
done, please feel free to write your arguments or lessons learned below.

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________
Question and Answer List

Do you have any questions for clarification?

Questions/Issues Answers
1.

2.

3.

Keywords Index

Analog Signal Digital Signal Digital Computers

Analog Computers Amplitude Frequency

Periodic Time Modulation Demodulation

Numbering System Boolean Logic Absolute Value

Place Value Total Value Base Value

Bit Byte Nibble

Word Double Word Binary Operator

Closure Associative Law Commutative Law

Identity Element Inverse Distributive Law

Huntington Postulates Duality Principle Boolean Function

Literal Logic Gates

You might also like