Monday, 20 July 2020

Unit-5 :Data Representation (Notes of TU BSc. 4th Year Computer Science)

Data Representation


Syllabus: Number system (Binary, Octal, Decimal, and Hexadecimal); Conversion from One Number System to Another; Binary Arithmetic (Addition and Subtraction); Logic gates

Number System

A number system defines a set of values to represent quantity. It is a set of rules to represent a number. There are 2 types of number systems,
  1. Non-Positional Number System
  2. Positional Number System
Binary, Octal, Decimal, and Hexadecimal number systems are positional number systems. So in this chapter, we’ll learn about the different positional number systems.

In each number system, the base is the total number of digits or symbols in that number system. The maximum value of single-digit in each number system is one less than that of the base. ( That also means that the base of any number system is one more than that of the maximum value of single-digit. )

Binary Number System

The binary number system is a positional number system. 
There are only two symbols or digits (i.e., 0 and 1) in Binary Number System; hence its base is  2.
The maximum value of single-digit is 1. Each position of a digit represents a specific power of the base (2).
This number system is used in computers. 
Eg. (10111001)2

Octal Number System

In the octal number system, there are 8 symbols or digits (i.e., 0, 1, 2, 3, 4, 5, 6, and 7); hence its base is 8. 
The maximum value of single-digit is 7. Each position of a digit represents a specific power of the base (8).
Eg. (62340)8 

Decimal Number System

In the decimal number system, there are 10 symbols or digits (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9); hence its base is 10. 
The maximum value of single-digit is 9. Each position of a digit represents a specific power of the base (10).
We use this number system in our day-to-day life.
Eg. (28940583)10

Hexadecimal Number System

Hexadecimal number system has 16 symbols or digits (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F) hence its base is 16. 
The symbols A, B, C, D, E, and F represent 10, 11, 12, 13, 14, and 15, respectively.
The maximum value of single-digit is 15. Each position of a digit represents a specific power of the base (16).
Eg. (A456FC)16

Conversion from One Number System to Another

Converting a number of another base to decimal number:

Step-1: Determine the column (positional) value of each digit
Step-2: Multiply the obtained column values by the digits in the corresponding columns
Step-3: Calculate the sum of these products

Converting decimal number to a number of another base:

Step-1: Divide the decimal number to be converted by the value of the new base
Step-2: Record the remainder from step-1 as the rightmost digit (least significant digit) of the new base system
Step-3: Divide the quotient of the previous by the new base
Step-4: Record the remainder from step-3 as the next digit (to the left) of the new base number
Step-5: Repeat step-3 and step-4, recording the remainders from right to left, until the quotient becomes zero in step-3.
Note: The last remainder obtained will be the Most Significant Digit (MSD) of the new base number. 

Converting a number of some base to a number of another base:

Step-1: Convert the original number to the Decimal number
Step-2: Convert the Decimal number obtained to the new base number

Shortcut Methods

Conversion from binary to octal:
Step-1: Divide the binary digits into the group of three (starting from the right),
Step-2: Convert each group of three binary digits to one octal digit.
Example,
Step no.
Binary number
Octal number
1
11001112
12 1002 1112
2
11001112
184878
3
11001112
1478
Therefore, (1100111)2 = (147)8

Conversion from octal to binary:
Step-1: Convert each octal number to binary equivalent (make the digit count 3 like 18 = 0012 )
Step-2: Combine converted binary numbers according to the position of the octal number
Step no.
Octal number
Binary number
1
1478
12 42 72
2
1478
001210021112
3
1478
11001112
Therefore, (147)8 = (1100111)2

Conversion from binary to hexadecimal:
Step-1: Divide the binary digits into a group of four (starting from the right),
Step-2: Convert each group of four binary digits to one hexadecimal digit.
Example,
Step no.
Binary number
Hexadecimal number
1
11001112
1102 01112
2
11001112
616716
3
11001112
6716
Therefore, (1100111)2 = (67)16

Conversion from hexadecimal to binary:
Step-1: Convert each Hexadecimal number to Binary equivalent (make the digit count 3 like 616 = 01102 )
Step-2: Combine converted Binary numbers according to the position of Hexadecimal number
Step no.
Hexadecimal number
Hexadecimal number
1
6716
6716
2
6716
616716
3
6716
01102 01112
Therefore, (67)16 = (1100111)2 



Binary Arithmetic

Binary Number System consists of 2 digits. They are 0 and 1. As like regular Decimal Numbers, we can perform addition, subtraction, multiplication as well as division. But in this chapter, we’ll only perform addition and subtraction. 

Addition

The addition is combining two digits to produce another higher value digit. 

The rule for Binary Addition is:
0
+
0
0
0
+
1
1
1
+
0
1
1
+
1
0 ( plus a carry of 1 to next higher column )

You can learn Addition in YouTube by clicking here.



Subtraction

Subtraction is the process of taking away some value from a digit resulting in the production of lower value digit.

The rule for Binary Subtraction is:
0
-
0
0
0
-
1
1 ( with borrow from the next column )
1
-
0
1
1
-
1
0

You can learn Subtraction in YouTube by clicking here.



Decimal Number System
Binary Number System
0
0
1
1
2
10
3
11
4
100
5
101
6
110
7
111
8
1000
9
1001

Logic Gates

Logic Gates are the electronic circuits that operate on one or more input signals. They are building blocks of all the circuits in a computer. Some of the basic and most useful logic gates are AND, OR, NOT, NAND, and NOR gates.

AND gate

The physical realization of logical multiplication (AND) operation. 
Generates an output signal 1 only if all input signals are also 1.



OR gate

The physical realization of logical addition (OR) operation.
Generates an output signal of 1 if at least one of the input signal is also 1.




NOT gate

The physical realization of complementation operation.
Generates an output signal, which is the reverse of the input signal.




NAND gate

Complemented AND gate. 
Generates an output signal of 1 if any one of the inputs is a 0 and generates 0 when all the inputs are 1.



NOR gate

Complemented OR gate.
Generates an output signal of 1 only when all inputs are 0 and generates 0 if any one of the inputs is a 1.












Saturday, 18 July 2020

Unit-3 :Data Communications and Computer Networks (Notes of TU BSc. 4th Year Computer Science)

Data Communications and Computer Networks

Syllabus: Basic Elements of a Communication System; Data Transmission Modes; Data Transmission Speed; Data Transmission Media; What is Computer Network? Network Types; Network Topologies; Communication Protocol; Wireless Networking 


Basic Elements of a Communication System 

  1. Sender (Source): The sender creates and sends a message. The message may be a command, request, question or idea. For that message to be received, the sender must first encode the message in the for that can be understood (by use of common language or industrial jargon), and then transmit it.
  2. Medium: The medium carries the message. After the message is composed, the sender sends the message to the receiver through a medium.
  3. Receiver (Sink): The receiver receives the message. To comprehend the information from the sender, the receiver must first be able to receive the sender’s information and then decode or interpret it.

Data Transmission Modes

  1. Simplex
    In this type of transmission mode, data can be sent only through one direction, i.e. communication is unidirectional. We cannot send the message back to the sender. Unidirectional communication is done in the Simplex System.
    Examples of simplex mode is a loudspeaker, Television broadcast, Radio broadcast, etc.
  2. Half-Duplex
    In the half-duplex system, we can send data in both directions, but it is done one at a time that is when the sender is sending the data then at that time we can’t send the sender our messages. The data is sent in one direction.
    Example of half-duplex is a walkie-talkie in which messages is sent one at a time and messages are sent in both directions.
  3. Full-Duplex
    In a full-duplex system, we can send data in both directions as it is bidirectional. Data can be sent in both directions simultaneously. We can send as well as receive the data.
    Example of full-duplex is a Telephone Network in which there is communication between two persons by a telephone line, through which both can talk and listen at the same time. 

Data Transmission Speed
It is the rate at which data is sent to or received from the network. The data transmission speed is measured as: 
Bandwidth: Bandwidth is the range of frequencies available for data transmission. It refers to the data transmission rate. Higher the bandwidth, the more data it can transmit.
Baud: Baud is the unit of measurement of data transfer rate. It is measured in bits per second (bps) 

The different category based on data transmission speed are:
Narrowband: Narrowband is sub-voice grade channels in a range from 45 to 300 baud. It is mainly used for telegraph lines and low-speed terminals.
Voiceband: Voiceband is voice-grade channels with speed up to 9600 baud. It is mainly used for ordinary telephone voice communication and slow Input/Output devices.
Broadband: Broadband is high-speed channels with speed up to 1 million baud or more. It is mainly used for high-speed computer-to-computer communication or for simultaneous transmission of data.

Data Transmission Media
Transmission media is a pathway that carries the information from the sender to the receiver. We use different types of cables or waves to transmit data. Data is transmitted generally through electrical or electromagnetic signals. There are 2 types of transmission media. They are:
  1. Bounded or guided transmission media
  2. Unbounded or unguided transmission media

Bounded or guided transmission media
It is the transmission media in which signals are confined to a specific path using wire or cable. The types of bounded/guided media are:

1) Twisted-pair wire (UTP cable)
It is the most common type of telecommunication which consists of two conductors usually copper, each with its own colour plastic insulator.
UTP cables consist of 2 or 4 pairs of twisted cable. Cable with 2 poor use RJ-11 connector and 4 pair cable use RJ-45 connector.
2) Coaxial cable
The coaxial cable contains 2 conductors that are parallel to each other. Copper is used in this as a centre conductor which can be a solid wire or a standard one. It is surrounded by PVC installation, a sheath which is encased in an outer conductor of metal foil, braid or both.
There are 2 types of coaxial cables:
A) Baseband (used for digital transmission)
B) Broadband (used for analogue transmission)
3) Optical fibres
These are similar to coaxial cable. It uses electric signals to transmit data. At the centre is a glass core through which light propagates. The core in optical fibre cable is surrounded by glass cladding with a lower index of refraction as compared to the core to keep all the lights in the core.
Optical fibre cable has bandwidth more than 2Gbps.


Unbounded or unguided transmission media
Unbounded or unguided or wireless transmission media sends the data through the air (or water), which is available to anyone who has the device capable of receiving them. The types of unbounded or unguided or wireless transmission media are:
  1. Communication satellites
    This is a microwave relay station which is placed in outer space. The satellites are launched wither by rockets or space shuttles carry them.
    The satellite is positioned in a geo-synchronous orbit, and it is stationary relative to the earth and always stays over the same point on the ground. It can have 6GHz of uplink and 4GHz of the downlink.
     
  2. Microwave system
    Microwave system has microwave transmission medium. It requires the sender to be inside of the receiver. It operates in a system with a low GigaHertz range. It is mostly used for unicast communication.

What is a Computer Network?
A computer network is a group of computers that use a set of standard communication protocols over digital interconnections to share resources located on or provided by the network nodes. The interconnections between nodes are formed from a broad spectrum of telecommunication network technologies.

Network Types
The different types of networks based on the distance approves are:

Local Area Network (LAN): A Local Area Network (LAN) is a group of computer and peripheral devices which are connected in a limited area such as school, laboratory, home, and office building. It is a widely useful network for sharing resources like files, printers, games, and other application. The simplest type of LAN network is to connect computers and a printer in someone's home or office.

Characteristics of a LAN network:
  • It is a private network, so an outside regulatory body never controls it.
  • LAN operates at a relatively higher speed compared to other WAN systems.
  • There are various kinds of media access control methods like token ring and ethernet.

Metropolitan Area Network (MAN): A Metropolitan Area Network or MAN is consisting of a
computer network across an entire city, college campus, or a small region. This type of network is larger than LAN, which is mostly limited to a single building or site. Depending upon the type of
configuration, this type of network allows you to cover an area from several miles to tens of miles.

Characteristics of the MAN network:
  • It mostly covers towns and cities in a maximum 50 km range.
  • Mostly used medium is optical fibres, cables.
  • Data rates adequate for distributed computing applications.

Wide Area Network (WAN): WAN (Wide Area Network) is another essential computer network
that which is spread across a large geographical area. WAN network system could be a
connection of a LAN which connects with other LAN's using telephone lines and radio waves. It is mostly limited to an enterprise or
an organisation.

Characteristics of the WAN network:
  • The software files will be shared among all the users; therefore, all can access to the latest files.
  • Any organisation can form its global integrated network using WAN.


Network Topologies
The term network topology refers to how the nodes of a network are linked together. Although number network topologies are possible, five major ones are: 

a) Star network
In star technology, each device is connected to the host through the host node. In this topology, direct communication between the invention is not allowed. If one device wants to send information to another device, the information reach to host and then the host transfers the information to the designated device.
Advantages: 1) Less expensive  2) Easier to install  3) Fault can be detected easily.
Disadvantages: 1) If the host goes down, everything goes down  2) Host requires more resources and regular maintenance.



















b) Ring network
In ring network topology, one device is connected to 2 another device on each side of the device. This forms a chain and finally forms ring-like structure hence called ring topology. The transfer of data is maintained in one direction with the help of repeater. If a device wants to send data to another device, the data gets circulated in the specific direction until it reaches the designated device.
Advantages: 1) Easy to install
Disadvantages: 1) A link failure can damage the entire network  2) Data traffic arises as all the data flows through the same link



















c) Completely connected network
In completely connected network topology, each device in the network is connected with every device available in the network. The data from one device can reach the designated device through their exclusive link.
Advantages: 1) Two devices can have their own link  2) breakage on one link do not fail the whole network.
Disadvantages: 1) It is expensive  2) cable management becomes an issue.

d) Multi-access bus network
In a multi-access bus network, every device shares a single communication line (link). All the devices are connected to one communication line, and all data are transferred through the same link.
Advantages: 1) Less expensive.
Disadvantages: 1) fault in the communication link can break whole network  2) difficult to identify the fault. 


e) Hybrid Network
A hybrid network is a combination of different type of network topologies. It may include a star, ring or bus topology.


Communication Protocol
The protocol is a set of formal operating rules, procedures, or conventions that govern a given process. Communication protocol describes rules that govern the transmission of data over communication networks.
The roles of the communication protocol are:
  1. Data sequencing
  2. Data routing
  3. Data formatting 
  4. Flow control 
  5. Error control 
  6. Precedence and order of transmission
  7. Connection establishment and termination
  8. Data security
  9. Log information

Communication protocols are normally split up into a series of modules logically composed of a succession of layers. The term protocol suite, protocol family or protocol stack are used to refer to the collection of protocols (of all layers) of a network system.
Wireless Networking
Wireless networking (or computing system) uses wireless communication technologies for interconnecting computer systems. It enhances the functionality of computing equipment by freeing communication from location constraints of wired computing systems
Wireless networking (or computing system) is of two types:
a) Fixed wireless systems: Fixed wireless system supports little or no mobility of the computing equipment associated with the wireless network 
b) Mobile wireless systems: Mobile wireless system supports the mobility of the computing equipment to access resources associated with the wireless network
Some of the wireless technologies that are used in wireless networking are:
  1. 2G and 3G
  2. Wireless LAN
  3. WiMAX
  4. Wireless Local Loop (WLL)
  5. Radio-router
  6. Multihop Wireless Network
  7. Wireless Application Protocol (WAP)