Sunday, 21 October 2012

Binary Number Part 4

Hexadecimal

Now that we are done with be Binary Numbers
Conversion and Operations, We will be moving to the next Number System which is Hexadecimal.

Hexadecimal is a number system which contains 16 digits. The numbers is:


0  1  2  3  4  5  6  7  8  9  A  B  C  D  E F

  

   *Keep in mind that this number could be represented in decimal as~
    -A represents 10
    -B represents 11
    -C represents 12
    -D represents 13
    -E represents 14
    -F represents 15



Converting Binary To Hexadecimal







By referring to the upper table, it's easier to understand how to convert binary to a hexadecimal number.However, I'm quite sure the table won't be given during any examination  so please memorize it okay?

Step1


Let says for example, we take 1000000000111111 as our 16 bit binary numbers,

First of all seperate the numbers into 4 bit binary numbers 

eg:


      1000   0000   0011   1111



Step2

Then change it into the binary by referring to it's value. For example  1111 is 15 means  it's F.

eg:


 


      1000   0000   0011   1111


         8          0         3       F


Therefore the answer is 803F!

Another simple steps isn't it? 


Here, for more detail about this conversion refer  below here :) 



 

                                                                                                  By : Lai Chai Teng



Number System Part 3


Operations Involving Binary Numbers


Mainly, there are 4 operations involving Binary Numbers, That is


1.Addition

2.Subtraction

3. Multiplication

4.Division


But i will cover ONLY on subtraction because other operation are as simple as normal

operation in decimal numbers.


For other operation involving Binary Numbers u can refer it on the video above







So I will explain to all of you currently reading this on subtraction between binary numbers.

This will require us to convert the binary numbers in to TWO's Complement.


What is a Two's Complement? Its a step to find a negative number for binary to use for subtraction

operation for binary numbers. The MSB (Most Significant Bit) of a negative binary must be 1.


"Keep in mind that even positive number has a Two's complement but it will turn  to be the same binary number due to the MSB (Most Significant Bit) must be a 0!!"

Steps to convert to a Two's Complement


1.Make sure change it to a nearest 4 times bits type either 4 bits , 8 bits or 16 bits.

2. Reverse all the Number of the binary means from 1 to 0 and 0 to 1




eg:


                         From -->

                                     0111


                         To --->

                                    1000



3.Add 1 to the LSB (Least Significant Bit)



eg:

                     1000 

                        + 1  
                      1001

Therefore the 2's Complement of 0111 is 1001 .



Looks like we are done with the binary numbers. Lets jump to Hexadecimal and Decimal Numbers.

                                                          By: Lai Chai Teng

DIGITAL LOGIC


TOPIC : DIGITAL LOGIC

Assalamualaikum and hi everyone. ^^
Before I moving on further, just a simple introduce about my self.
The names given is Nur Umira Binti Mustafa. Well,you can just call me Nur. ^^
I studying in Technical University Malaysia Melaka (UTEM) , and taking software development as my course.
Alright,lets quick chatting and start with our main topic for today’s discussion. .. ^^

LEARNING OUTCOMES

In order for you to fully understand and take a full control of this topic, you need to dig out a few information about the basic component in this topic.
Lets we analyst our learning outcomes of this discussion

1) understand and apply basic logic gates
2) understand and apply law and rules of Boolean,algebra and DeMorgan’s theorems to Boolean expressions
3) Able to design a combinational logic circuit for given Boolean output expression.

// The learning outcomes seems though isn’t it..?
But don’t worry, neither you are beginner nor expert, I will share all information about this topic with you, to enable you to get more detail information about this topic.

WHAT IS LOGIC GATE ?

So,friends, have you ever wondering what is meant by LOGIC GATE ?

Do you still remember what is BOOLEAN ALGEBRA ?

(if you can answer 2 simple warming up questions above, you are ready to explore this topic ^^ )

Boolean algebra
ALTERNATIVE NAME : Boolean logic  
WHAT IS IT ?
: is a logical calculus of truth values.
:It resembles the algebra of real numbers
 but with the numeric operations of >
-multiplication xy
-addition x + y
-negation x replaced by the respective logical operations of conjunction xy,  
-disjunction xy
-negation ¬x.
-The Boolean operations are these and all other operations that can be built from these, such as x(yz). These turn out to coincide with the set of all operations on the set {0,1} that take only finitely many arguments; there are 2^2^n such operations when there are n arguments.

Basic logic gates

Boolean algebra uses variables and operation to represent the logic circuit. The variables and the function have the only and value, 0 and 1 .
The compliment of the value is shown by a bar over the letter or a single quotes on the right side above the
letter.
Example : A’ / B’


Type
Distinctive shape
Rectangular shape
Boolean algebra between A & B
Truth table
AND

A.B
INPUT
OUTPUT
A
B
A AND B
0
0
0
0
1
0
1
0
0
1
1
1
OR

A+B
INPUT
OUTPUT
A
B
A OR B
0
0
0
0
1
1
1
0
1
1
1
1
NOT

INPUT
OUTPUT
A
NOT A
0
1
1
0
NAND


INPUT
OUTPUT
A
B
A NAND B
0
0
1
0
1
1
1
0
1
1
1
0
NOR



INPUT
OUTPUT
A
B
A NOR B
0
0
1
0
1
0
1
0
0
1
1
0
XOR
INPUT
OUTPUT
A
B
A XOR B
0
0
0
0
1
1
1
0
1
1
1
0
XNOR


 or 
INPUT
OUTPUT
A
B
A XNOR B
0
0
1
0
1
0
1
0
0
1
1
1


DECORDER :
}  Use decoder to build larger components
}  The most common type of decoder has an n-bit input and 2n outputs, where only one output is asserted for each input combination.
}  This decoder translates the n-bit input into a signal that corresponds to the binary value of the n-bit input.
}  The outputs are shows a 3-bit decoder and the truth table. This decoder is called a 3-to-8 decoder
}  since there are 3 inputs and 8 (23) outputs. There is also a logic element called an
}  encoder that performs the inverse function of a decoder, taking n inputs and producing
}  an n-bit output.
}  This decoder is called a 3-to-8 decoder means 3 inputs and 8 (23) outputs. There is also a logic element called an encoder that performs the inverse function of a decoder, taking n inputs and producing an n-bit output.


Multiplexor (Selector)
}  The output is one of the inputs that is selected by a CONTROL


}  The left side shows this multiplexor has three inputs: two data values and a selector (or control) value. The selector value determines which of the inputs becomes the output. We can represent the logic function computed by a two-input multiplexor, shown in gate form on the right side as C = (A & S’ ) + (B & S)
}  Multiplexors can be created with an arbitrary number of data inputs.
}  If there are only two inputs, the selector is a single signal that selects one of the inputs
}  if it is true (1) and the other if it is false (0). If there are n data inputs, there will need to be log2n selector inputs.
}  In this case, the multiplexor basically consists of 3 parts:
}  1. A decoder that generates n signals, each indicating a different input value
}  2. An array of n AND gates, each combining one of the inputs with a signal from the decoder
}  3. A single large OR gate that incorporates the outputs of the AND gates
}  To associate the inputs with selector values, we often label the data inputs numerically



How to deal with COMBINATIONAL CIRCUITS ?

~ For your information , a logic block contains no memory and computes the output given the current inputs.

~ combinational circuits can be defined in three ways.

1) truth table – the truth table shows many possible combination of input values, in tabular from between the input values and the result of a specific Boolean operator or combination on the input variables.

IMPORTANT !
    
For n inputs,there are 2n of combination

2) Graphical symbol – the layout of connected gates that represent the logic circuit

examples :





















3) Boolean equations- Boolean function that consist possible combination of inputs that produce an output signal.


Boolean Equations Forms.
A Boolean algebra is the combination of variables and operators. Typically , it has one or more input and produces an output in the range of 0 or 1. The compliment of a variable is shown by bar or a single quotes on the right side above the letter.
Example : A’ / B’



All Boolean equation can be represent in two forms :

Sum of Products Expansion(SOP )
Definition
-     Combination of input values that produce 
1s is convert into equivalent variables, AND ed, together then OR ed with other combination variables with same output.
-     SOP is easier to derive from the truth
Table.

IMPORTANT ! 
Sum of products for Boolean function is a Boolean expression constructed by:

-Where each OUTPUT result is a 1
-form product of all variables
-sum each product

Definition 1
Sum-of-products expansion
is the sum of minterms.
Disjunctive normal form
is the same as sum-of-products.



 Definition 2

Literal
is a Boolean variable or its complement.
Minterm
of the Boolean variables x1, x2, ..., xn is a
Boolean product y1, y2, ..., yn where yi=xi or yi=xi


D
Example 1:
F and G of Table 1 are expressed as sum of minterms.
F(x,y,z) = xyz                The sum of one minterm.
G(x,y,z) = xyz + xyz     The sum of two minterms.
Example 2 :
Minterm that is 1 for x1 = 0, x2 = 0, x3 = 1, x4 = 1
x1x2x3x4 = 1

 Example 3

Find Boolean EQUATION based on TRUTH Table 1.
            H   =  X’Y’ + XYZ’
TABLE 1 :
X
Y
Z
           H   
0
0
0
1
0
0
1
1
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
0
1
1
1
0t








SOLUTION

X
Y
Z
X’Y’
XYZ’
           H   
0
0
0
1
0
1 X’Y’Z’
0
0
1
1
0
1 X’Y’Z
0
1
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
0
1
0
1
0
0
0
1
1
0
0
0
0
1
1
1
0
0
0









      H = (X’Y’Z’) + (X’Y’Z)

                                                 By: Nur Umira
Product-of-sum( POS )
Definition
-     Input combination that produce 0 in the sum term ( OR’ed variables ) are AND’ed together.
-     Convert input values that produce 0s into equivalent variables, OR’ed the variables, the AND’ed with other OR’ED forms
-     Usually use if more 1s produce in output function.
same output.


IMPORTANT !
PRODUCT of SUM for Boolean function is a Boolean expression constructed by:
-Where each OUTPUT result is a 0
-form SUM of all variables
-MULTIPLY each SUM OF VARIABLE




EXAMPLE 4:

         Find Boolean EQUATION based on TRUTH Table 2.

      H = (A+B+C)(A+B+C’)(A+B’+C)(A’+B+C’)


PRODUCT TERM
(1)A+B+C                  
(2)A+B+C’
(3)A+B’+C
(4)A’+B+C’

A
B
C
           H   
0
0
0
0
0
1
0
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
1
1
1
1
1

  
 (1)
 (2)
 (3)




(4)



POS Expressions :

H = (A+B+C)(A+B+C’)(A+B’+C)
-note : this is not simplified versions
SIMPLIFICATION OF BOOLEAN EQUATIONS

Rules of Boolean Algebra
Table 4-1 lists 12 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 previously discussed.
Table 4-1 Basic rules of Boolean algebra.



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 in Fig.(4-6), where the lower input is fixed at 0.


Fig.(4-6)
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 in Fig.(4-7), where the lower input is fixed at 1.

Fig.(4-7)
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 in Fig.(4-8), where the lower input is fixed at 0.
Fig.(4-8)
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 in Fig.(4-9), where the lower input is fixed at 1.


Fig.(4-9)

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 in Fig.(4-10), where both inputs are the same variable.
Fig.(4-10)

Rule 6. A + 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 Fig.(4-11), where one input is the complement of the other.
Fig.(4-11)

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. Fig.(4-12) illustrates this rule.


Fig.(4-12)
Table 4-2

Rule 11. A + AB = A + B
This rule can be proved as follows:
A + AB = (A + AB) + AB
= (AA + AB) + AB =AA +AB +AA +AB
= (A + A)(A + B) = 1. (A + B)
= A + B
 


                                                                    By:Amirul Ramzani