# AND GATE

The AND gate is an electronic circuit that has two or more inputs and only one output. It gives a HIGH output (1) only if all its inputs are HIGH.

+
Ans: A Boolean or logic expression is a logic variable or a number of logic variables involved with one another through the logical operations ‘.’, ‘+’, and ‘–’. view more..
+
Ans: 2’s complement A number formed by adding 1 to the 1’s compliment of a number. The 2’s complement representation has become the standard method of storing signed binary integers. It allows the representation of an n-bit number in the range – 2n to 2n-1, and has the significant advantage of only having one encoding for 0. view more..
+
Ans: 1’s complement A number system that was used in some computers to represent negative numbers. To form 1s complement of a number, each bit of the number is inverted which means zeros are replaced with ones and ones with zero. view more..
+
Ans: The AND gate is an electronic circuit that has two or more inputs and only one output. It gives a HIGH output (1) only if all its inputs are HIGH. view more..
+
Ans: The OR gate is an electronic circuit that has two or more inputs and only one output. It gives a HIGH output if one or more of its inputs are HIGH. view more..
+
Ans: NOT GATE also called INVERTER.The inverter is a little different from AND and OR gates as it has only one input and one output. Whatever logic state is applied to the input, the opposite state will appear at the output. The NOT function is denoted by a horizontal bar over the value to be inverted. view more..
+
Ans: The Exclusive-OR or XOR gate is a two-input circuit that will give a HIGH output if either, but not both, of the inputs are HIGH. The XOR function is an interesting and useful variation of the basic OR function. Its function can be stated as ‘Either A or B, but not both’. The XOR gate produces a logic 1 output only if the two inputs are different. If the inputs are the same, the output is a logic 0. XOR is also called an anti-coincidence gate or inequality detector. view more..
+
Ans: The Exclusive-NOR gate is a XOR gate followed by a NOT gate. XNOR gate is a two-input and one-output logic gate circuit. In the gate, the output is HIGH if both inputs are either LOW or HIGH view more..
+
Ans: A programming language can be defined formally as an artificial formalism in which algorithms can be expressed. It is composed of a set of instructions in a language understandable to the programmer and recognizable by a computer. Computer languages have been continuing to grow and evolve since the 1940’s. Assembly language was the normal choice for writing system software like operating systems, etc. But, C has been used to develop system software since its emergence. The UNIX operating system and its descendants are mostly written in C. Application programs are designed for specific computer applications. Most programming languages are designed to be good for one category of applications but not necessarily for the other. For an instance, COBOL is more suitable for business applications whereas FORTRAN is more suitable for scientific applications. view more..
+
Ans: A program, written in source language, is translated by the compiler to produce a program in a target language. The source language is usually a high-level language. The target language may or not necessarily be machine language. In most cases, the target language is assembly language, and in which case, the target program must be translated by an assembler into an object program. Then the object program is linked with other object programs to build an executable program, which is normally saved in a specified location of the secondary memory. When it is needed to be executed, the executable file is loaded into main memory before its execution. The whole process is managed, coordinated and controlled by the underlying operating system. Sometimes the target language may be a language other than machine or assembly language, in which case a translator for that language must be used to obtain an executable object program. view more..
+
Ans: Lexical analysis In this phase, the source program is scanned for lexical units (known as tokens) namely, identifier, operator delimiter, etc. and classify them according to their types. A table, called symbol table, is constructed to record the type and attributes information of each user-defined name used in the program. This table is accessed in the other phases of compilation. view more..
+
Ans: Syntax analysis In this phase, tokens are conflated into syntactic units such as expressions, statements, etc. that must conform to the syntax rules of the programming language. This process is known as parsing. Syntax is similar to the grammar of a language. Syntax rules specify the way in which valid syntactic elements are combined to form the statements of the language. Syntax rules are often described using a notation known as BNF (Backus Naur Form) grammar. view more..
+
Ans: Semantic analysis :The semantics of a statement in a programming language define what will happen when that statement is executed. Semantic rules assign meanings to valid statements of the language. In the semantic analysis phase, the parsed statements are analysed further to make sure that the operators and operands do not violate source language specification. view more..
+
Ans: Intermediate code generation and optimization To make the target program a bit smaller or faster or both, many compilers produce an intermediate form of code for optimization. In most cases, the intermediate code is generated in assembly language or in a different language at a level between assembly language and machine language. view more..
+
Ans: Code generation This is the final phase of a standard compilation which converts every statement of the optimized intermediate code into target code using predefined target language template. The target language template depends on the machine instructions of the processor, addressing modes and number of registers, etc. view more..
+
Ans: Most of the high-level languages provide libraries of subroutines or functions so that certain common operations may be reused by system-supplied routines without explicit coding. Hence, the machine language program produced by the translator must normally be combined with other machine language programs residing within the library to form a useful execution unit. This process of program combination is called linking and the software that performs this operation is variously known as a linker. The features of a programming language influence the linking requirements of a program. In languages like FORTRAN, COBOL, C, all program units are translated separately. Hence, all subprogram calls and common variable references require linking. Linking makes the addresses of programs known to each other so that transfer of control from one subprogram to another or a main program takes place during execution. view more..
+
Ans: There are three types of translators, namely Assembler, Compiler and Interpreter. Assembler converts one assembly language statement into a single machine language instruction. . Depending on its implementation, a high-level language employs a compiler or an interpreter or both for translation. One statement in a high-level programming language will be translated into several machine language instructions. Both compiler and interpreter translate a program written in high-level language into machine language but in different fashion. Compiler translates the entire source program into object program at once and then the object files are linked to produce a single executable file. Unlike compiler, an interpreter translates one line of source code at a time—then executes it—before translating the next one and it does this every time the program executes. BASIC is a language that is usually implemented with an interpreter. Translation using an interpreter is slower than that using a compiler. The interpreter translates each line of source code to machine code each time the program is executed. With respect to debugging, an interpreted language is better than the compiled language. In an interpreter, syntax error is brought to the attention of the programmer immediately so that the programmer can make necessary corrections during program development. The Java language uses both a compiler and an interpreter. view more..
+