Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Computer Code Introduction The Language of electronic component is binary All numeric and non-numeric data must be converted into binary language so that computer can understand it Representation of all numeric and non-numeric data in binary digits is known as computer code Computer code is represented in different coding schemes Coding Schemes BCD Code ASCII Code EBCDIC Code Unicode BCD Code Stands for Binary Coded Decimal Used to represent decimal digits in binary 4-bit code Each decimal digit is represented by 4 binary digits Used by early computers BCD Code http://electronicsarea.com/bcd-code/ Example http://electronicsarea.com/bcd-code/ Example http://electronicsarea.com/bcd-code/ ASCII Code American Standard Code for Information Interchange Most widely used coding scheme for personal computers 7-bit code can represent 128 characters Not enough to represent some graphical characters displayed on computer screens An 8 bit code can represent 256 characters Extended 128 unique codes represent graphic symbols ASCII Code http://www.gjszlin.cz/ivt/esf/ostatni-sin/kodovani-textu.php?lang=1 Example Character B i n a r y Decimal Code 66 105 110 97 114 121 Binary Code 01000010 01101001 01101110 01100001 01110010 01111001 EBCDIC Code Extended Binary Coded Decimal Interchange Code 8-bit code Divided into two group of 4 bits Each group cam represent one hexadecimal digit Normally used in mainframe computers Can represent 256 characters EBCDIC Code http://www.rtty.com/CODECARD/codecrd1.htm Unicode 16 bit code Represent 65536 characters Started to replace ASCII code Can represent the characters of all languages in the world Boolean Algebra Algebra of logic Also called logical algebra or switching algebra Uses symbols to represent logical statements instead of words Consists of different rules to manipulate rules Similar to calculus Boolean Algebra Used in the designing of logic circuits in computer Computer chips consists of transistors that are arranged in logical gates Each gate performs a single logical operation Computer performs logical operation by processing electrical pulses Design of a particular circuit is based on a set of logical statements Results of boolean algebra can be true or false The digit 1 indicates true and 0 indicates false result Elements of Boolean Algebra An expression in Boolean Algebra can be formed using different elements of Boolean algebra Different elements of Boolean algebra are as follows: ◦ ◦ ◦ ◦ Boolean Variables Boolean Constants Logical Operators Parentheses Logical Operators in Boolean Algebra Symbols used to perform logical operations are called logical operators Different logical operators are: ◦ AND ◦ OR ◦ NOT Basic Logic Gates Many basic functions of the arithmetic and control units are carried out by logic gates Each gate accepts input and produces an output ◦ ◦ ◦ ◦ ◦ ◦ ◦ NOT Gate AND Gate OR Gate NAND Gate NOR Gate XOR Gate XNOR Gate Boolean Expression Logical statement that is either true or false Consists of different elements of Boolean Algebra Logic Diagrams and Expressions Logic Equation Truth Table XY Z F = X + YZ 000 0 001 1 010 0 011 0 100 1 101 1 110 1 111 1 F = X +Y Z Logic Diagram X Y F Z Boolean equations, truth tables and logic diagrams describe the same function! Truth tables are unique, but expressions and logic diagrams are not. This gives flexibility in implementing functions. Boolean Algebra Invented by George Boole in 1854 An algebraic structure defined by a set B = {0, 1}, together with two binary operators (+ and ·) and a unary operator ( ) Identity element 1. X +0= X 2. X .1=X 3. X+ 1=1 4. X .0=0 5. X+X=X 6. X .X = X Idempotence 7. X+X=1 8. X .X = 0 Complement 9. X=X Involution 10. X +Y = Y + X 11. 12. 13. (XY) Z = X(Y Z) Associative 14. (X + Y) + Z = X + (Y + Z) X(Y + Z) = XY + XZ 15. X + YZ = (X + Y) (X + Z) Distributive 16. X +Y =X .Y 17. X .Y = X +Y DeMorgan ’s XY = YX Commutative References Slides Taken From: www.cse.yorku.ca/~mack/1011/01.NumberSystems.p pt Introduction to Information Technology by Riaz Shahid, CM Aslam and Safia Iftikhar The Concepts of Information Technology by Imran Saeed, Ahsan Raza, Tariq Mehmood and Zafar Hussain