Posts

logical OR Operation

Image
The logical OR operation between two Boolean variables A and B, given as Y= A+, is represented by table. This table shows the result of the OR operation on the variable A and B is logical 1 when A or B (or both) are logical 1. The common symbol used for this logical addition operation is the plus sign (+).

Logical AND Operation

Image
The logical AND operation of two Boolean variables A and b, given as Y=A, is represented by table. The common symbol for this operation is the multiplication sign (.). The table shows that the result of the AND operation on the variables A and B is logical 0 for all cases, except when both A and B are logical 1. Usually, the dot denoting the AND function is omitted and A.B is written as AB.

BOOLEAN LOGIC OPERATIONS

A Boolean function is an expression formed using binary constants, binary variable and basic logical operation symbols. Basic logical operations include the AND function (logical multiplication), the OR function (logical addition) and the NOT function (logical Complementation ), A Boolean function can be converted into a logical diagram composed of the AND, OR and NOT gates.

DEVELOPMENT OF BOOLEAN ALGEBRA

Mathematician George Boole invented a new kind of algebra, the algebra of logic in the year 1854 popularly known as Boolean Algebra or Switching Algebra. He stated that symbols can be used to represent the structure of logical thought. Boolean algebra differs significantly from conventional algebra. This algebra deals with the rules by which the logical operations are carried out. here, a digital circuit is represented by a set of input and output symbols and the circuit functions expressed as a set of Boolean relationships between this symbols.            Boolean expressions are basically defined by stating that (i) a constant is a Boolean expression and (ii) a variable is a Boolean expression. For example, if A is a Boolean expression, so is A bar. The combination of variables such as A bar B and A bar B+C are also Boolean expressions. However, A-B is not a Boolean expression.

Types of C variables

As we saw earlier, an entity that may very during program execution is called a variable. Variable manes are names given to locations in memory. these locations can contain integer, real or character constant. In any language, the types of variables that it can support depend on the type of constants that it can handle.This is because a particular type of variable can hold only the same type of constant. For example, an integer variable can hold only an integer constant, a real variable can hold only a real constant and a character variable can hold only a character constant. Rules for Constructing Variables Names   (a) A variable name in any combination of 1 to 31 alphabets, digits or underscores. Some compiler allow variable manes, whole length could be up to 247 characters. Still, it would be safer to stick to the rule of 31 characters. Do not create unnecessarily long variable names as it adds to your typing effort.   (b) The first character in the variable name must...

Type of C constants

Image
C constants can be divided into two major categories :      (a)    Primary Constants      (b)    Secondary Constants these constant are further are categorized as shown in in figure. At this stage, we would restrict our discussion to only primary constants, namely, Integer, Real and Character constants. Let us see the details of each of these constants. For constructing these different types of constants, certain rules have been laid down. These rules are as under.   Rules for Constructing Integer Constants   (a) An integer constant must have at least one digit.   (b) It must not have a decimal point.   (c) It can be either positive or negative.   (d) If on sign precedes an integer constant, it is assumed to be positive.   (e) No commas or blanks are allowed within an integer constant.   (f) The allowable range for integer constant is -2147483648 to +2147483647. Ex :-  482   ...

Constants, Variables and Keywords

Image
the alphabets, numbers and special symbols when properly combined form constants, variables and keywords. Let us see what are 'constants' and 'variables' in C.   A constants is an entity that does not change, whereas, a variable is an entity that may change. In any program we typically do lots of calculations. the result of these calculations are stored in computer's memory. Like human memory, the computer memory also consists of millions of cells. the calculate values are stored in the memory cells. To make the retrieval and used of this values easy these memory cells (also called memory location) are given name. Since the value stored in each location may change the names given to these locations are called variable names. Consider the example shown in bellow.    Here 4 is stored in a memory location and a name X is given to it. then we have assigned a new value 7 to the same memory location X. This would overwrite the earlier value 4, since a memory locatio...