## Pages

### Boolean Algebra : Truth Table

A truth table is a table in which the truth or falsity of a statement is listed for all possible proposition conditions. A truth able lists the value of the dependent variable for each set of values of the independent variables. Suppose there are three variables C, A and B, wherein the variable C is being derived from some expression based on the variables A and B.
Then, C is called the dependent variable because i is dependent on and being derived from A and B. Variables A and B are independent variables because they do not depend on any thing. So, in this example, preparing a truth table means deriving the value for dependent variable i.e. C for each set of values of independent variables (A and B).
Bu in Boolean algebra any variable can have only two values i.e. 0 and 1.
So A and B can only have values 0 and 1.
together they can have 4 possible combinations of 0 and 1 as follows.

Table 1 : Possible values of A and B
A                B
0                 0
0                 1
1                 0
1                 1
Calculating the value for C for each possible set of values of A and B is called the Truth Table.

Table 2 : Truth able for values of A, B, and C
A                B               C
0                 0                0
0                 1                0
1                 0                0
1                 1                1

### Boolean Algebra : Binary Valued Quantities

What we think of in our daily life involves finding answer to two valued questions: like "Is the action RIGHT or WRONG"? Is this statement TRUE or FALSE?
Such type of decision statements which result in YES or NO, RUE or FALSE. RIGHT or WRONG are binary decisions. In electronics it is used in addition to describe circuits whose state can be either 1(true) or 0 (false). Two-state logic or proposition had a major influence on Aristotle, who worked out precise methods for getting to the truth.
Then Augustus de Morgan found the link between logic and mathematics. But it was George Boole who invented a new kind of algebra by putting it all together. therefore it is known as Boolean Algebra.
Boolean Algebra is he algebra of binary variables. Binary variables are also known as Boolean Variables. Boolean variable can have only two values, 0 and 1. he mathematical operations available are AND, OR, and NOT.

### Boolean Algebra : Introduction

Boolean pronounced as booln is an abstract mathemetical sysem primarily used in expressing the relationships between sets(groups of objects). The English mathemtician George Boole developed this notational system. Such manipulation can demonsrate whether or not a statement is true and show how a complicated statement can be rephrased in a simpler, more convenient form without changing its meaning.
The phrase Boolean operators refer to the system of logic developed by George Boole. The so-called operators are AND, OR, and NOT and more recently terms such as NEAR, IN, and ADJ have been added to the list.
They represent logical ways of combining concepts, words, and ideas. Boolean operators if used in a search statement either narrow, expand, or limit the search result. Two of the most powerful operators are NEAR and ADJ.
NEAR when used between two words means that those words are found near each other in the records
ADJ means that two words are found next to each other in the records.
AND results in key words being located seperately in different documents.
There is a tenuous relationship between Boolean functtions and Boolean expressions in programming languages like C or Pascal.
However the relationship between Boolean Logic and computer systems is much stronger.
There is a one-to-one relationship between Boolean functions and electtronic circuits.

A utility program that combines several separately compiled modules into one, resolving internal differences between them.
When a program is assembled/compiled, an intermediate form is produced into which it is necessary to incorporate libraries, and any other modules supplied by the user.

A Loader is a utility program that sets up an executable program in main memory ready for execution. This is the final sage of the compiling / assembly process. A loader is a program that loads the machine codes of memory. It accepts programs in absolute or re-locatable formats

Assembler:
Software that converts an assembly language program into machine language program(also known as machine code or relocatable code) is known as an assembler. the machine in this case understands only he binary language. So, any program written in a language other than machine language has to be converted in zeros and ones for the machine to understand and process.

Text Editor:
A Program used specifically for entry and modification of data in text format. Such data may be a program written in a high level language, a report in natural language, or a numerical input.
It is a software used to review and modify text materials and other programs interactively. It can be a text editor, screen editor, etc

Compilers:
A Compiler is a system program which accepts program written in a high-level language such as BASIC as input and produces an equivalent output in low level language such as assembly language or machine language, so as to make i machine-readable.

### Device Management

An operating system is a resource manager which is responsible for the allocation of various resources. Resources such as CPU and main memory are considered pre-emptible. A user program that occupies a particular range of location in main memory may be removed or pre-empted by another program. CPU is the most pre-emptible resource on a computer system. Thus, the control of CPU can be transferred from one process to another.
Certain resources are not pre-emptible. They cannot be removed from the processes to which they are assigned. Tape drives for example, are normally assigned to a particular process for several minutes or hours and as long as it is assigned to one process, it cannot be taken from that process and given to others.
Share and Non-sharable Resources.
Some resources may be shared among several processes while others are dedicated to a single process. Main memory and CPU are shared among many processes and hough CPU can belong o one process at a time, the muliplexing of CPU among many processes creates the illusion of simultaneous sharing.
While disk drives are sometimes dedicated to a single process( are non-sharable) devices such as printers and keyboard are non-sharable resources.
Buffering
A buffer is an area of memory used to hold daa during input/ouput transfer to or form a disk or tape and from the keyboard to the printer.
Spooling
Spool stands for Simultaneous Periperals Operations On Line. Spooling is a technique used to reduce the speed mismatch between high-speed CPU and slow-speed devices such as printers. For example, if a program that sends lines to the printer waits for each line to be printed before it can transmit the next line, the program will be executed slowly. to speed up program execution, output lines are routed to a faster device such as the disk drive, where they are temporarily stored until they are printed. This procedure is called spooling.
Difference between Spooling and Buffering
Spooling is usually associated with printing jobs whereas Buffering allocates memory for any kind of job. Buffering also allows the use of main memory for performing some other functions temporarily.

### Memory Management

The part of the Operating System (OS) which manages memory is known as the memory manager.

Contiguous Memory Allocation

Early Computer Sysems in the beginning were designed for contiguous memory allocation. This meant that each program hat ran and entered in main memory was allocated a single contiguous memory allocation.
Under the multi-programming system that developed laer, it was felt hat it would be better to use non-contiguous memory allocation.
In the case of non-contiguous memory allocation a program is divided into several processes which are placed in main memory in pieces that are not necessarily adjacent to each other. The operating sysem can load and execute a program whenever needed, if the main memory has many small segments free(instead of a single large area).
Partitioned Allocation(Non Contiguous Memory Allocation)
This type of allocation is required and used in a multi-user and muli-programming environment. A major drawback of the single-user or single-program sysem was tha CPU time was wased while the program was performing doing an I/O operation. Multi-program computers were designed in order o make use of the ime during which the CPU was idle. his meant that program had to share the memory available. So, memory go partitioned.
Partitioned allocaion is of two ypes:
1. Fixed
2. Variable

Fixed Partition Allocation
A fixed portion of memory is allocated o every program hat enters main memory. The primary disadvantage of fixed partition allocation is hat memory is wasted if it holds a small program. Another disadvantage is that a program of a size larger that the fixed partition cannot enter main memory if the specified number of partitions are no available. The solution for the above problem can be found in variable partition allocation
Variable Partition Allocation
In this kind of allocation, programs are allowed to occupy as much space as they need. this should be lesser than the maximum main memory. Memory is added or removed later as required.

Relocation Allocation
In a multiple programming environment, more than one program runs simultaneously in main memory with variable partition allocation. Small free memory holes are created in main memory when small programs are processed and removed.
Relocation allocation is the technique wherein programs which are already running and available in main memory are relocated, so as to combine these small fragmented areas o form a large memory area.

Virtual Memory
Virtual memory is a memory management technique developed for multitasking. This technique virtualizes a computer architecture's various forms of computer data storage (such as random-access memory and disk storage), allowing a program to be designed as though there is only one kind of memory, "virtual" memory, which behaves like directly addressable read/write memory (RAM).

Most modern operating systems that support virtual memory also run each process in its own dedicated address space. Each program thus appears to have sole access to the virtual memory.
Systems that employ virtual memory use hardware memory more efficiently than do systems without virtual memory.
Virtual memory makes application programming easier by hiding fragmentation of physical memory; by delegating to the kernel the burden of managing the memory hierarchy (eliminating the need for the program to handle overlays explicitly); and, when each process is run in its own dedicated address space, by obviating the need to relocate program code or to access memory with relative addressing.