Gray Code To convert the number from binary to Gray code the relations must be known. = = = = Ex Convert the binary number ( ) into Gray Code? bit األول من جهة اليسار ومن ثم تطبق Gray لتحويل الرقم من صيغة ال Binary العالقات السابقة الى صيغة يتم انزال ال ( ) 2 = ( ) G bit ألرجاع الرقم من صيغة Gray والرقم الذي يليه الى ال Binary يتم انزال اول من جهة اليسار وتطبيق العالقات بين الناتج ASCII Character Code The standard binary code for the alphanumeric characters is called ASCII (American Standard Code for Information Interchange). It uses 7 bits to code 28 characters, as shown in the table. The seven bits of the code are designed by B through B7, with B7 being the most significant bit. Note that the most significant three bits of the code determine the column of the table and the least significant four bits the row of the table. For example, the letter A is represented n ASCII as ( ) ( column, row ). The ASCII code contains 94 2
characters that can print and 34 nonprinting used in control functions. The printing characters consist of 26 uppercase letters, the 26 lowercase letters, numerals, and 32 special printable character such as %, @ and $. Ex What are the character corresponding to the ASCII code? ( )ASCII ( )ASCII = JOHN DEV Binary Logic and Logic Gates Binary logic is used to describe, in mathematical way, the manipulation and processing of binary information. It is suited for the analysis and design of digital system. The logic circuits (gates) establish the logical manipulation. The logic gates are:- - AND Gate Input =. OR Gate Input = + 2
3 Not Gate = input x z 4 Buffer Gate = input x z 5 NAND Gate Input =.
6 NOR Gate Input = ( + ) 7 Exclusive OR Gate = = = + Input 8 - Exclusive NOR Gate Input =. =. = + Boolean Algebra A useful mathematical system for specifying and transforming logic functions, Boolean algebra has six theorems and four postulates The. a - + = b -. = The. 2 a - + = b -. = The. 3 ( ) = involution The. 4 a + ( + ) = ( + ) + associative b - ( ) = ( ) 2
The. 5 a ( + ) =. Demorgan theorm b - ( ) = + The. 6 a - + = b - ( + ) = Absorption Post. a + = b. = Post. 2 a - + = b -. = Post. 3 a - + = + b = commutative Post.4 a ( + ) = + b - + = ( + ) ( + ) Distributive Boolean Function Evaluation A binary variable can take the value of or. a Boolean function is an expression formed with binary variable, the two binary operators OR and AND, the NOT operator, parentheses and equal sign. For a given value of the variables, the function can be either or, for example the following Boolean functions:- F = F2 = + Any Boolean function can be represented in a truth table. The number of rows in the table is n 2, where n is the number of binary variables in the function. The binary numbers is then counting from to n 2 -. The truth table for the above functions: Inputs s F F2 2
The Boolean function may be transformed to logic diagram composed of AND, OR and NOT gates. Complementing Functions: Use DeMorgan's Theorem to complement a function:.- Interchange AND and OR operators 2.- Complement each constant value and literal Ex Fined the complement of the functions:- F = + 2 F2 = ( + ) Ex Apply Demorgan theorem to the following expressions - A B ( C D + E F ) 2- ( A + B C + C D ) + B C Canonical and Standard Forms Minterms and Maxterms: Any Boolean function can be expressed in a canonical form, canonical form include:- - Sum of Minterms ( SOM) 2- Product of Maxterms (POM) In Minterms each variable being primed if the corresponding bit of the binary number is and unprimed if a.in Maxters each variable being unprimed if the corresponding bit of the binary number is and primed if a. 2
Minterms Designation Maxterms Designation M + + M M + + M M2 + + M2 M3 + + M3 M4 + + M4 M5 + + M5 M6 + + M6 M7 + + M7 The Sum of Minterms of the function is expressed by thr ORing to the minterms when the output is ( F = ). The Product of Maxterms of the function is expressed by ANDing to the maxterms when the output is ( F = ). Ex Find the Sum of Minterms 2 Product of Maxterms of F :- F : Sum of Minterms ( ) + ( ) + ( ) = M + M4 + M7 = Σ (, 4, 7 ) 2- Product of Maxterms ( + + ). ( + + ). ( + + ). ( + + ). ( + + ) = M. M2. M3. M5. M6 = Π (, 2, 3, 5, 6 ) 2
Ex Express each of the following functions in Canonical Forms F F2 Ex Express the Boolean function F = A + B C in Sum of Minterms:- The function has three variables A, B, C. the first term missing two variables A = A. by. = = A ( B + B ) by + = = A B + A B = A B ( C + C ) + A B ( C + C ) = A B C + A B C + A B C + A B C The second term missing one variable B C = B C ( A + A ) = A B C + A B C F ( A, B, C ) = A B C + A B C + A B C + A B C + A B C = + + + + = m7 + m6 + m5 + m4 + m = Σ (, 4, 5, 6, 7 ) Ex Express the Boolean function F = + in product Maxterms First the function must converted into OR terms using distributed low F = + = ( + ) ( + ) = ( + ) ( + ) + ( + ) ( + ) = ( + ) ( + ) ( + ) Each term is missing one variable 2
+ = + + by + = = + + by. = = ( + + ) ( + + ) by + = ( + ) ( + ) + = + + = + + = ( + + ) ( + + ) + = + + = + + = ( + + ) ( + + ) = ( + + ) ( + + ) F = ( + + ) ( + + ) ( + + ) ( + + ) = M4. M5. M. M2 = Π (, 2, 4.5 ) Ex Express the boolean function F in - Sum of Minterms 2 Product of Maxterms F = A ( B + C ) Sum of Minterms F ( A, B, C ) = A ( B + C ) = A B + A C The first term missing one variable A B = A B. = A B ( C + C ) = A B C + A B C The second term missing one variable A C = A C. = A C ( B + B ) = A B C + A B C F ( A, B, C ) = A B C + A B C + A B C = + + = M3 + M2 + M (, 2, 3 ) 2 Product of Maxterms F ( A, B, C ) = A ( B + C ) The first term missing two variables A = A + = A + B B = ( A + B ) ( A + B ) = ( A + B + ) ( A + B + ) = ( A + B + C C ) ( A + B + C C ) 2
= ( A + B + C ) ( A + B + C ) ( A + B + C ) ( A + B + C ) The second term missing one variable B + C = B + C + = B + C + A A = ( B + C + A ) ( B + C + A ) = ( A + B + C ) ( A + B + C ) F ( A, B, C ) = ( A + B + C ) ( A + B + C ) ( A + B + C ) ( A + B + C ) ( A + B + C ) = M4. M5. M6. M7. M = Π (, 4, 5, 6, 7 ) Ex express the function F in Sum of Minterms and Product of Maxterms and simplify it F Sum of Minterms F (,, ) = + + + + = ( + ) + + ( + ) = + + = ( + ) + = + = + = ( + ) ( + ) = + Standard Forms Another way to express Boolean function is in standard form. In this form, the terms form the function may contain one, two, or any number of literals, there are two types of standard form: Sum of Product: this expression contain AND terms, called product term, of one or more literals each, and the sum ( OR ing ) between these terms 2
Ex F = + + 2 Product of Sum: this expression contain OR terms, called sum term, of one or more literals each, and the product ( AND ing ) between these terms Ex F =. ( + ). ( + + + W ) Ex F = ( A B + C D ) ( A B + C D ) It a non standard form and it can converted to standard form by using distributed law: F = A B C D + A B C D 22