Thursday, August 4, 2022

Input/Output Ports



A connection point that acts as interface between the computer and external devices like mouse, printer, modem, etc. is called port. Ports are of two types −

  • Internal port − It connects the motherboard to internal devices like hard disk drive, CD drive, internal modem, etc.

  • External port − It connects the motherboard to external devices like modem, mouse, printer, flash drives, etc.

Input Output Ports

Let us look at some of the most commonly used ports.

Serial Port

Serial ports transmit data sequentially one bit at a time. So they need only one wire to transmit 8 bits. However it also makes them slower. Serial ports are usually 9-pin or 25-pin male connectors. They are also known as COM (communication) ports or RS323C ports.

Serial Ports

Parallel Port

Parallel ports can send or receive 8 bits or 1 byte at a time. Parallel ports come in form of 25-pin female pins and are used to connect printer, scanner, external hard disk drive, etc.

Parallel Ports

USB Port

USB stands for Universal Serial Bus. It is the industry standard for short distance digital data connection. USB port is a standardized port to connect a variety of devices like printer, camera, keyboard, speaker, etc.

USB Port

PS-2 Port

PS/2 stands for Personal System/2. It is a female 6-pin port standard that connects to the male mini-DIN cable. PS/2 was introduced by IBM to connect mouse and keyboard to personal computers. This port is now mostly obsolete, though some systems compatible with IBM may have this port.

Infrared Port

Infrared port is a port that enables wireless exchange of data within a radius of 10m. Two devices that have infrared ports are placed facing each other so that beams of infrared lights can be used to share data.

Bluetooth Port

Bluetooth is a telecommunication specification that facilitates wireless connection between phones, computers and other digital devices over short range wireless connection. Bluetooth port enables synchronization between Bluetooth-enabled devices. There are two types of Bluetooth ports −

  • Incoming − It is used to receive connection from Bluetooth devices.

  • Outgoing − It is used to request connection to other Bluetooth devices.

FireWire Port

FireWire is Apple Computer’s interface standard for enabling high speed communication using serial bus. It is also called IEEE 1394 and used mostly for audio and video devices like digital camcorders.

Secondary Memory



You know that processor memory, also known as primary memory, is expensive as well as limited. The faster primary memory are also volatile. If we need to store large amount of data or programs permanently, we need a cheaper and permanent memory. Such memory is called secondary memory. Here we will discuss secondary memory devices that can be used to store large amount of data, audio, video and multimedia files.

Characteristics of Secondary Memory

These are some characteristics of secondary memory, which distinguish it from primary memory −

  • It is non-volatile, i.e. it retains data when power is switched off
  • It is large capacities to the tune of terabytes
  • It is cheaper as compared to primary memory

Depending on whether secondary memory device is part of CPU or not, there are two types of secondary memory – fixed and removable.

Secondary Memory

Let us look at some of the secondary memory devices available.

Hard Disk Drive

Hard disk drive is made up of a series of circular disks called plattersarranged one over the other almost ½ inches apart around a spindle. Disks are made of non-magnetic material like aluminum alloy and coated with 10-20 nm of magnetic material.

Hard Disk Drive

Standard diameter of these disks is 14 inches and they rotate with speeds varying from 4200 rpm (rotations per minute) for personal computers to 15000 rpm for servers. Data is stored by magnetizing or demagnetizing the magnetic coating. A magnetic reader arm is used to read data from and write data to the disks. A typical modern HDD has capacity in terabytes (TB).

CD Drive

CD stands for Compact Disk. CDs are circular disks that use optical rays, usually lasers, to read and write data. They are very cheap as you can get 700 MB of storage space for less than a dollar. CDs are inserted in CD drives built into CPU cabinet. They are portable as you can eject the drive, remove the CD and carry it with you. There are three types of CDs −

  • CD-ROM (Compact Disk – Read Only Memory) − The data on these CDs are recorded by the manufacturer. Proprietary Software, audio or video are released on CD-ROMs.

  • CD-R (Compact Disk – Recordable) − Data can be written by the user once on the CD-R. It cannot be deleted or modified later.

  • CD-RW (Compact Disk – Rewritable) − Data can be written and deleted on these optical disks again and again.

DVD Drive

DVD stands for Digital Video Display. DVD are optical devices that can store 15 times the data held by CDs. They are usually used to store rich multimedia files that need high storage capacity. DVDs also come in three varieties – read only, recordable and rewritable.

DVD Drive

Pen Drive

Pen drive is a portable memory device that uses solid state memory rather than magnetic fields or lasers to record data. It uses a technology similar to RAM, except that it is nonvolatile. It is also called USB drive, key drive or flash memory.

Pen Drive

Blu Ray Disk

Blu Ray Disk (BD) is an optical storage media used to store high definition (HD) video and other multimedia filed. BD uses shorter wavelength laser as compared to CD/DVD. This enables writing arm to focus more tightly on the disk and hence pack in more data. BDs can store up to 128 GB data.

Primary Memory



Memory is required in computers to store data and instructions. Memory is physically organized as a large number of cells that are capable of storing one bit each. Logically they are organized as groups of bits called words that are assigned an address. Data and instructions are accessed through these memory address. The speed with which these memory addresses can be accessed determines the cost of the memory. Faster the memory speed, higher the price.

Computer memory can be said to be organized in a hierarchical way where memory with the fastest access speeds and highest costs lies at the top whereas those with lowest speeds and hence lowest costs lie at the bottom. Based on this criteria memory is of two types – primary and secondary. Here we will look at primary memory in detail.

The main features of primary memory, which distinguish it from secondary memory are −

  • It is accessed directly by the processor
  • It is the fastest memory available
  • Each word is stored as well as
  • It is volatile, i.e. its contents are lost once power is switched off

As primary memory is expensive, technologies are developed to optimize its use. These are broad types of primary memory available.

Primary Memory

RAM

RAM stands for Random Access Memory. The processor accesses all memory addresses directly, irrespective of word length, making storage and retrieval fast. RAM is the fastest memory available and hence most expensive. These two factors imply that RAM is available in very small quantities of up to 1GB. RAM is volatile but my be of any of these two types

DRAM (Dynamic RAM)

Each memory cell in a DRAM is made of one transistor and one capacitor, which store one bit of data. However, this cell starts losing its charge and hence data stored in less than thousandth of a second. So it needs to be refreshed thousand times a second, which takes up processor time. However, due to small size of each cell, one DRAM can have large number of cells. Primary memory of most of the personal computers is made of DRAM.

SRAM (SRAM)

Each cell in SRAM is made of a flip flop that stores one bit. It retains its bit till the power supply is on and doesn’t need to be refreshed like DRAM. It also has shorter read-write cycles as compared to DRAM. SRAM is used in specialized applications.

ROM

ROM stands for Read Only Memory. As the name suggests, ROM can only be read by the processor. New data cannot be written into ROM. Data to be stored into ROM is written during the manufacturing phase itself. They contain data that does not need to be altered, like booting sequence of a computer or algorithmic tables for mathematical applications. ROM is slower and hence cheaper than RAM. It retains its data even when power is switched off, i.e. it is non-volatile. ROM cannot be altered the way RAM can be but technologies are available to program these types of ROMs −

PROM (Programmable ROM)

PROM can be programmed using a special hardware device called PROM programmer or PROM burner.

EPROM (Erasable Programmable ROM)

EPROM can be erased and then programmed using special electrical signals or UV rays. EPROMs that can be erased using UV rays are called UVEPROM and those that can be erased using electrical signals are called EEPROM. However, handling electric signals is easier and safer than UV rays.

Cache Memory

Small piece of high speed volatile memory available to the processor for fast processing is called cache memory. Cache may be a reserved portion of main memory, another chip on CPU or an independent high speed storage device. Cache memory is made of fast speed SRAMs. The process of keeping some data and instructions in cache memory for faster access is called caching. Caching is done when a set of data or instructions is accesses again and again.

Whenever the processor needs any piece of data or instructions, it checks the cache first. If it is unavailable there, then the main memory and finally secondary memory is accessed. As cache has very high speed, time spent in accessing it every time is negligible as compared to time saved if data indeed is in the cache. Finding data or instruction in cache is called cache hit.

Evaluation of Microprocessor



The first microprocessor introduced in 1971 was a 4-bit microprocessor with 4m5KB memory and had a set of 45 instructions. In the past 5 decades microprocessor speed has doubled every two years, as predicted by Gordon Moore, Intel co-founder. Current microprocessors can access 64 GB memory. Depending on width of data microprocessors can process, they are of these categories−

  • 8-bit
  • 16-bit
  • 32-bit
  • 64-bit

Size of instruction set is another important consideration while categorizing microprocessors. Initially, microprocessors had very small instructions sets because complex hardware was expensive as well as difficult to build.

As technology developed to overcome these issues, more and more complex instructions were added to increase functionality of the microprocessor. However, soon it was realized that having large instruction sets was counterproductive as many instructions that were rarely used sat idle on precious memory space. So the old school of thought that supported smaller instruction sets gained popularity.

Let us learn more about the two types of microprocessors based on their instruction set.

RISC

RISC stands for Reduced Instruction Set Computers. It has a small set of highly optimized instructions. Complex instruction are also implemented using simpler instructions, reducing the size of instruction set. The designing philosophy for RISC incorporates these salient points −

  • Number of instructions should be minimum.
  • Instructions should be of same length.
  • Simple addressing modes should be used
  • Reduce memory references to retrieve operands by adding registers

Some of the techniques used by RISC architecture include −

  • Pipelining− A sequence of instructions is fetched even if it means overlapping of instructions in fetching and execution.

  • Single cycle execution − Most of RISC instructions take one CPU cycle to execute.

Examples of RISC processors are Intel P6, Pentium4, AMD K6 and K7, etc.

CISC

CISC stands for Complex Instruction Set Computers. It supports hundreds of instructions. Computers supporting CISC can accomplish wide variety of tasks, making them ideal for personal computers. These are some characteristics of CISC architecture −

  • Larger set of instructions
  • Instructions are of variable length
  • Complex addressing modes
  • Instructions take more than one clock cycle
  • Work well with simpler compilers

Examples of CISC processors are Intel 386 & 486, Pentium, Pentium II and III, Motorola 68000, etc.

EPIC

EPIC stands for Explicitly Parallel Instruction Computing. It is a computer architecture that is a cross between RISC and CISC, trying to provide the best of both. Its important features include −

  • Parallel instructions rather than fixed width
  • Mechanism to communication compiler’s execution plan to hardware
  • Programs must have sequential semantics

Some EPIC processors are Intel IA-64, Itanium, etc.

Microprocessor Concepts



Microprocessor is the brain of computer, which does all the work. It is a computer processor that incorporates all the functions of CPU (Central Processing Unit) on a single IC (Integrated Circuit) or at the most a few ICs. Microprocessors were first introduced in early 1970s. 4004 was the first general purpose microprocessor used by Intel in building personal computers. Arrival of low cost general purpose microprocessors has been instrumental in development of modern society the way it has.

Microprocessor

We will study the characteristics and components of a microprocessor in detail.

Microprocessors Characteristics

Microprocessors are multipurpose devices that can be designed for generic or specialized functions. The microprocessors of laptops and smartphones are general purpose whereas ones designed for graphical processing or machine vision are specialized ones. There are some characteristics that are common to all microprocessors.

These are the most important defining characteristics of a microprocessor −

  • Clock speed
  • Instruction set
  • Word size

Clock Speed

Every microprocessor has an internal clock that regulates the speed at which it executes instructions and also synchronizes it with other components. The speed at which the microprocessor executes instructions is called clock speed. Clock speeds are measured in MHz or GHz where 1 MHz means 1 million cycles per second whereas 1 GHz equals to 1 billion cycles per second. Here cycle refers to single electric signal cycle.

Currently microprocessors have clock speed in the range of 3 GHz, which is maximum that current technology can attain. Speeds more than this generate enough heat to damage the chip itself. To overcome this, manufacturers are using multiple processors working in parallel on a chip.

Word Size

Number of bits that can be processed by a processor in a single instruction is called its word size. Word size determines the amount of RAM that can be accessed at one go and total number of pins on the microprocessor. Total number of input and output pins in turn determines the architecture of the microprocessor.

First commercial microprocessor Intel 4004 was a 4-bit processor. It had 4 input pins and 4 output pins. Number of output pins is always equal to the number of input pins. Currently most microprocessors use 32-bit or 64-bit architecture.

Instruction Set

A command given to a digital machine to perform an operation on a piece of data is called an instruction. Basic set of machine level instructions that a microprocessor is designed to execute is called its instruction set. These instructions do carry out these types of operations −

  • Data transfer
  • Arithmetic operations
  • Logical operations
  • Control flow
  • Input/output and machine control

Microprocessor Components

Compared to the first microprocessors, today’s processors are very small but still they have these basic parts right from the first model −

  • CPU
  • Bus
  • Memory

CPU

CPU is fabricated as a very large scale integrated circuit (VLSI) and has these parts −

  • Instruction register − It holds the instruction to be executed.

  • Decoder − It decodes (converts to machine level language) the instruction and sends to the ALU (Arithmetic Logic Unit).

  • ALU − It has necessary circuits to perform arithmetic, logical, memory, register and program sequencing operations.

  • Register − It holds intermediate results obtained during program processing. Registers are used for holding such results rather than RAM because accessing registers is almost 10 times faster than accessing RAM.

Bus

Connection lines used to connect the internal parts of the microprocessor chip is called bus. There are three types of buses in a microprocessor −

  • Data Bus − Lines that carry data to and from memory are called data bus. It is a bidirectional bus with width equal to word length of the microprocessor.

  • Address Bus − It is a unidirectional responsible for carrying address of a memory location or I/O port from CPU to memory or I/O port.

  • Control Bus − Lines that carry control signals like clock signals, interrupt signal or ready signal are called control bus. They are bidirectional. Signal that denotes that a device is ready for processing is called ready signal. Signal that indicates to a device to interrupt its process is called an interrupt signal.

Memory

Microprocessor has two types of memory

  • RAM − Random Access Memory is volatile memory that gets erased when power is switched off. All data and instructions are stored in RAM.

  • ROM − Read Only Memory is non-volatile memory whose data remains intact even after power is switched off. Microprocessor can read from it any time it wants but cannot write to it. It is preprogrammed with most essential data like booting sequence by the manufacturer.

Number System Conversion



As you know decimal, binary, octal and hexadecimal number systems are positional value number systems. To convert binary, octal and hexadecimal to decimal number, we just need to add the product of each digit with its positional value. Here we are going to learn other conversion among these number systems.

Decimal to Binary

Decimal numbers can be converted to binary by repeated division of the number by 2 while recording the remainder. Let’s take an example to see how this happens.

Decimal To Binary

The remainders are to be read from bottom to top to obtain the binary equivalent.

4310 = 1010112

Decimal to Octal

Decimal numbers can be converted to octal by repeated division of the number by 8 while recording the remainder. Let’s take an example to see how this happens.

Decimal To Octal

Reading the remainders from bottom to top,

47310 = 7318

Decimal to Hexadecimal

Decimal numbers can be converted to octal by repeated division of the number by 16 while recording the remainder. Let’s take an example to see how this happens.

Decimal To Hexadecimal

Reading the remainders from bottom to top we get,

42310 = 1A716

Binary to Octal and Vice Versa

To convert a binary number to octal number, these steps are followed −

  • Starting from the least significant bit, make groups of three bits.

  • If there are one or two bits less in making the groups, 0s can be added after the most significant bit

  • Convert each group into its equivalent octal number

Let’s take an example to understand this.

Binary To Octal

101100101012 = 26258

To convert an octal number to binary, each octal digit is converted to its 3-bit binary equivalent according to this table.

Octal Digit01234567
Binary Equivalent000001010011100101110111

 

546738 = 1011001101110112

Binary to Hexadecimal

To convert a binary number to hexadecimal number, these steps are followed −

  • Starting from the least significant bit, make groups of four bits.

  • If there are one or two bits less in making the groups, 0s can be added after the most significant bit.

  • Convert each group into its equivalent octal number.

Let’s take an example to understand this.

Binary To Hexadecimal

101101101012 = DB516

To convert an octal number to binary, each octal digit is converted to its 3-bit binary equivalent.

Number System



The technique to represent and work with numbers is called number systemDecimal number system is the most common number system. Other popular number systems include binary number system, octal number system, hexadecimal number system, etc.

Decimal Number System

Decimal number system is a base 10 number system having 10 digits from 0 to 9. This means that any numerical quantity can be represented using these 10 digits. Decimal number system is also a positional value system. This means that the value of digits will depend on its position. Let us take an example to understand this.

Say we have three numbers – 734, 971 and 207. The value of 7 in all three numbers is different−

  • In 734, value of 7 is 7 hundreds or 700 or 7 × 100 or 7 × 102
  • In 971, value of 7 is 7 tens or 70 or 7 × 10 or 7 × 101
  • In 207, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 100

The weightage of each position can be represented as follows −

Decimal Number System

In digital systems, instructions are given through electric signals; variation is done by varying the voltage of the signal. Having 10 different voltages to implement decimal number system in digital equipment is difficult. So, many number systems that are easier to implement digitally have been developed. Let’s look at them in detail.

Binary Number System

The easiest way to vary instructions through electric signals is two-state system – on and off. On is represented as 1 and off as 0, though 0 is not actually no signal but signal at a lower voltage. The number system having just these two digits – 0 and 1 – is called binary number system.

Each binary digit is also called a bit. Binary number system is also positional value system, where each digit has a value expressed in powers of 2, as displayed here.

Binary Number System

In any binary number, the rightmost digit is called least significant bit (LSB) and leftmost digit is called most significant bit (MSB).

MSB lsb

And decimal equivalent of this number is sum of product of each digit with its positional value.

110102 = 1×2+ 1×23 + 0×22 + 1×21 + 0×20

= 16 + 8 + 0 + 2 + 0

= 2610

Computer memory is measured in terms of how many bits it can store. Here is a chart for memory capacity conversion.

  • 1 byte (B) = 8 bits
  • 1 Kilobytes (KB) = 1024 bytes
  • 1 Megabyte (MB) = 1024 KB
  • 1 Gigabyte (GB) = 1024 MB
  • 1 Terabyte (TB) = 1024 GB
  • 1 Exabyte (EB) = 1024 PB
  • 1 Zettabyte = 1024 EB
  • 1 Yottabyte (YB) = 1024 ZB

Octal Number System

Octal number system has eight digits – 0, 1, 2, 3, 4, 5, 6 and 7. Octal number system is also a positional value system with where each digit has its value expressed in powers of 8, as shown here −

Octal Number System

Decimal equivalent of any octal number is sum of product of each digit with its positional value.

7268 = 7×8+ 2×81 + 6×80

= 448 + 16 + 6

= 47010

Hexadecimal Number System

Octal number system has 16 symbols – 0 to 9 and A to F where A is equal to 10, B is equal to 11 and so on till F. Hexadecimal number system is also a positional value system with where each digit has its value expressed in powers of 16, as shown here −

Hexa Number System

Decimal equivalent of any hexadecimal number is sum of product of each digit with its positional value.

27FB16 = 2×163 + 7×162 + 15×161 + 10×160

= 8192 + 1792 + 240 +10

= 1023410

Number System Relationship

The following table depicts the relationship between decimal, binary, octal and hexadecimal number systems.

HEXADECIMALDECIMALOCTALBINARY
0000000
1110001
2220010
3330011
4440100
5550101
6660110
7770111
88101000
99111001
A10121010
B11131011
C12141100
D13151101
E14161110
F15171111

ASCII

Besides numerical data, computer must be able to handle alphabets, punctuation marks, mathematical operators, special symbols, etc. that form the complete character set of English language. The complete set of characters or symbols are called alphanumeric codes. The complete alphanumeric code typically includes −

  • 26 upper case letters
  • 26 lower case letters
  • 10 digits
  • 7 punctuation marks
  • 20 to 40 special characters

Now a computer understands only numeric values, whatever the number system used. So all characters must have a numeric equivalent called the alphanumeric code. The most widely used alphanumeric code is American Standard Code for Information Interchange (ASCII). ASCII is a 7-bit code that has 128 (27) possible codes.

ASCII Code

ISCII

ISCII stands for Indian Script Code for Information Interchange. IISCII was developed to support Indian languages on computer. Language supported by IISCI include Devanagari, Tamil, Bangla, Gujarati, Gurmukhi, Tamil, Telugu, etc. IISCI is mostly used by government departments and before it could catch on, a new universal encoding standard called Unicode was introduced.

Unicode

Unicode is an international coding system designed to be used with different language scripts. Each character or symbol is assigned a unique numeric value, largely within the framework of ASCII. Earlier, each script had its own encoding system, which could conflict with each other.

In contrast, this is what Unicode officially aims to do − Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language.

AntiVirus

Antivirus software is designed to find known viruses and oftentimes other malware such as Ransomware, Trojan Horses, worms, spyw...