simple logic gates

I.Boolean operators

AND

Figure 1: AND (from CORE COMPUTER SCIENCE)

OR

If one or both of the switches are closed, the light will be on.

NOT

This operator take the input and output the reverse.

NAND

The NAND operator has an output of 1 when one or both inputs are 0.

NOR

The NOR operator has an output of 1 when both inputs are 0.

Figure 2: NOR (from CORE COMPUTER SCIENCE)

XOR

When input are 0 and 1, the output is 1.

Figure 3: logical operations (from CORE COMPUTER SCIENCE)

II. Truth tables

Figure 4: complex truth table (from CORE COMPUTER SCIENCE)

III. Boolean expressions

Figure 5: properties of algebra (from CORE COMPUTER SCIENCE)

IV. Logic and Venn diagrams

Figure 6: diagrams (from CORE COMPUTER SCIENCE)

binary representation

I. Bit, byte, binary, decimal and hexadecimal

>> bit and Byte

Computer systems are binary systems that use sequences of bits to represent data. A binary digit (bit) is the basic unit of information in computer systems and can have only two values: wither 1 or 0. Eight bits form a byte.

1 Byte = 8 bits

A bit is denoted by the small letter b, whereas a Byte is denoted by the capital letter B. Thus, 1B=8b.

>> decimal number system

The decimal number system is a positional system that uses ten digits (0,1,2,3,4,5,6,7,8,9,) to represent any number. The decimal number system (or base-10) has ten as its base and it is the most widely-used number system.
Since base-10 is a positional system, the position of each digit within a number provides the multiplier by which that digit is multiplied.

Figure 1: Initial place values in the decimal number system
(from CORE COMPUTER SCIENCE)

>> binary number system

The binary number system is a positional system that uses two digits (0 and 1) to represent any number.

Figure 2: initial place values in the binary number system
(from CORE COMPUTER SCIENCE)
Figure 3: convert decimal number into binary number (from CORE COMPUTER SCIENCE)

Two’s complement is the way most modern computers represent signed binary numbers. The main advantage of this representations is that addition, subtraction and multiplication are carried out easily.
suppose we want to find -28
28 in an 8-bit register is 00011100.
fist, we invert the digits, so all ones become zeros and all zeros become ones. We get 11100011.
Then we add 1, and the output is 11100100.
So this is -28 in two’s complement representation.

In binary system the radix point is used to separate the fractional from the whole part. Fixed point representation method is the method using 4 bits for the integer part and 4 bits for the fractional part.

Figure 4: binary fraction (from CORE COMPUTER SCIENCE)

The hexadecimal number system is a positional system that uses 16 digits (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F) to represent any number. Digits A to F represent quantities from 10 to 15, thus A=10, B=11, C=12,D=13.E=14,F=15.

II. Data representation

>>Integers

We can use one byte to represent 256 different integer numbers. This would allow us to represent all the unsigned positive integers from 0 to 255.

Figure 5: positive integers (from CORE COMPUTER SCIENCE)

We can also use sign-and-magnitude number representation. The left-most bit is set to 0 for a positive number or 1 for a negative number. This allows for numbers -127 to +127 to be represented.

>>Characters

The American Standard Code for Information Interchange (ASCII) is a character-encoding scheme originally based on the English alphabet. ASCII uses 7 bits to represent each character, which means that it can achieve 128 different representations.

>>Colors

Monitors use pixels to display information and have a specific display resolution, such as 1024 x 768 has a width of 1024 pixels and a height of 768 pixels. One way to store color in pixels is the hexadecimal RGB color values. Each color value is represented by values from 00 to FF, so a six-digit hexadecimal number is need such as 70EF5A.

Figure 6: color representation (from CORE COMPUTER SCIENCE)

Operating and application systems

I. Functions of an operating system

An operating system (OS) is a set of software that controls the computer’s hardware resources and provides services for computer programs. It is a very important part of a computer system since it acts as an intermediary between software applications and the computer hardware.

Figure 1: User, application, OS and hardware (from CORE COMPUTER SCIENCE)

In a computer system, a user would interact with an application that has been designed to meet the user’s need. This application would require an operating system in order to function. This operating system would allow the application to interact with the hardware of the computer system.

The main services that an operating system provides are listed below:
> Peripheral communication
> Memory management
> Resource monitoring and multitasking
> Networking
> Disk access and data management
> Security

Figure 2: Security (from CORE COMPUTER SCIENCE)

II. Software application

Application software are programs designed for the end-user that enable the completion of various tasks in order to increase productivity. The main software applications that may be installed on such computer system include:
> Word processors
> Spreadsheets
> Database management systems
> Web browsers
> Email
> Computer Aided Design (CAD)
> Graphic processing software

III. Common features of applications

Software applications typically include a graphical user interface (GUI) to allow the user to interact with them in a number of ways. A GUI includes components such as graphical icons and visual indicators, as well as toolbars, menus, and dialogue boxes. These allow the interaction between the user and the software application to be performed more smoothly.

> Toolbar
A toolbar is a GUI element on which buttons, icons, menus, or other input or output elements are placed.
> Menu
A menu is a GUI element that displays a list of commands that can be chosen by the user to perform various functions.
> Dialogue
A dialogue box is a GUI element that is used to communicate information to the user and allow him/her to respond by choosing an option form a list of specific choices.

Figure 4: A dialogue box (from CORE COMPUTER SCIENCE)

Software applications have improved greatly over the years. Early software applications operated with commands that had to be typed in, which we call command line interfaces (CLIs). Later ones took advantage of GUIs.

Figure 5: Pros and Cons of CLIs and GUIs (from CORE COMPUTER SCIENCE)

SECONDARY MEMORY

Persistent storage and secondary memory

Secondary memory (a.k.a. secondary or auxiliary storage) is a relatively slow memory that may be written to but is also non-volatile. What’s more, secondary memory has a relatively high capacity to hold data compared to the primary memory.

Figure 1: CPU, primary and secondary memory ( from CORE COMPUTER SCIENCE)

When the computer stars-up the RAM is empty. Instructions and data need to be copied from secondary memory into the RAM in order for the computer system to run. This is very important since if secondary memory did not exist a computer system would be unable to store instructions and data persistently.

There are numbers of different secondary memory storage devices:
> Hard drive (hard disk)
> CD-RW, DVD-RW
> USB Flash drive
> SD (secure digital) or CF (compact flash) card
> zip disk
> Floppy disk
> Magnetic tape

Figure 2: Hard drive ( from CORE COMPUTER SCIENCE)
Figure 3: USB Flash drive ( from CORE COMPUTER SCIENCE)
Figure 4: A loaded DVD drive ( from CORE COMPUTER SCIENCE)

As secondary memory is obviously crucial to computer systems, it becomes apparent that advances in the technology surrounding secondary memory are beneficial to computer system as a whole. New technologies and existing ones strive to become more efficient, robust, and faster, as well as to hold more data than before.

COMPUTER ARCHITECTURE

I. The central processing unit (CPU) and its elements

Computer systems follow the concept of the input, process, output and storage model.

Figure 1: The input, process and output model (from CORE COMPUTER SCIENCE)

Data or instructions are processed by the central processing unit (CPU), which is a hardware component of a computer system and can perform basic arithmetic, logical or input/output operations, in order to process data from input devices into useful information. The CPU is the brain of a computer system and can process data very quickly, but it cannot think for itself (it can only process data by following instructions).

The CPU contains:
> control unit (CU)
> arithmetic logic unit (ALU)
> memory address register (MAR)
> memory data register (MDR)

The CU controls the retrieval of instructions from the primary memory as well as the sequence of their execution.
The ALU performs all the basic arithmetic, logical or input/output operations.
The MAR holds the memory address of the data to be used in ALU, so that ALU can fetch the corresponding content from the memory. The MAR may also hold the memory address of where data will need to be stored. In order for the MAR to communicate with the primary memory, a connection is necessary (Memory (Address) Bus).
The MDR holds the data that is to be used by the ALU and then saved to the RAM.

Figure 2: CPU block diagram ( from CORE COMPUTER SCIENCE)

II. The RAM and ROM

The primary memory is the only storage that is directly accessible by the CPU. The primary memory consist of two types of memory:

Random Access Memory (RAM) is a general-purpose storage area, so the data stored can be over-written. However, RAM is volatile, which means that whenever power is lost the contents of its memory are wiped clean.

On the other hand, Read Only Memory (ROM) is used to store instructions and data that cannot be over-written, and it is considered non-volatile. ROM is much smaller than RAM.

III. The cache memory

RAM has two main types:
>Dynamic RAM (DRAM)
>Static RAM (SRAM)
SRAM is faster but more expensive than DRAM, and as such DRAM is preferred for the main RAM. However, a small amount of SRAM is placed between the main RAM and the processor and it is called cache. Cache holds the information from the RAM that is most actively used, and accessed most frequently. The computer system will run faster as the slower main memory will need to be accessed less frequently.
There are two types of cache. L1 cache is placed on the microprocessor itself whereas L2 cache is placed between the primary memory and the microprocessor.

IV. The machine instruction cycle

  1. fetch instruction from primary memory to control unit
  2. decode instruction in control unit
  3. execute instruction
  4. store result and check for next instruction