Monday, 28 August 2023

B01: Computer Network and Hardware Essential

 Network Communication

kilobits per second (kbps)-measures data transfer speed

kilobyte per second(KBps)- measure file size

1 kb/s= 1000bits per second 

1KB/s= 1024 bytes per second


Computer Network is a set of nodes connected by communication links.

A node can be computer, printer or an other device capable of sending/receiving data generated by other nodes in the network. Ex, Computer, server , printer

Network medium can be wired(cables) or wireless(air)

Interconnecting device allows two or more computer to connect to connect to network without having to be directly connected to one another.

Network Interface Card(NIC)

  • Hardware computer 
  • provides connections between computer and network
  • wired network
Software Component
  • Network clients software 
    • Initiate requests stored on another network computer or devices (chrome web browser)
  • Network server software
    • It responds to clients software and share its resources (Apache web browser)
  • Protocols
    • defines rules and format used by a computer when sending information across the network(TCP/IP protocol stack)
  • NIC driver 
    • data is received from the protocols and transfer it to the physical NIC
Layers of Network Communication Process

User Application- Tries to access network resources

Network software- Client software detects and passes to network protocol

Network protocol- formats the message and transfers to NIC driver

Network interface

How two computer communicate on LAN 

  • TCP/IP is common protocols used on network
  • TCP/IP uses two addresses:
    • Logical Address(IP address)
    • Physical Address(MAC address)
  • Addresses are required in order to deliver data to the correct device on network.
Broadcast IP address
  • It is designed to facilitate message broadcasting for all network devices
Network Terminology

  1. Internetwork
    • Network collection of LAN tied together by devices such as routers
    • it is created to foster information exchange and collaboration, to facilitate global communication
  2. PAN(Personal Area Network)
    • wireless, short ranged (connected via Bluetooth)
    • private ownership
    • It covers small area
    • allows communication between various connected device
  3. LANs(Local Area Network)
    • It can be both wired(Ethernet) and wireless
    • It covers local area (larger than PAN)
    • short ranged but can extend up to few kilometers using wired communication 
    • it is used for local communication and resources sharing among multiple user.
  4. MANs(Metropolitan Area Network)
    • Mixture of both wired and wireless
    • Covers larger geographical than LAN (covers different part of city)
    • It is expensive
  5. WANs(Wide Area Network)
    • Relies on satellite and PSTN
    • Larger area than LAN and MAN often spanning countries and continents
  6. Internet
    • Accessible to all (world-wide network)
    • Uses protocols such as TCP/IP and HTTP
  7. Intranet
    • Restricted access
    • A private internetwork
  8. Extranet
    • Accessible to authorized users
    • controlled extension of an intranet that allows external parties.

    Private IP Address 

  • Reserved for private network
  • Used within private network to connect security to other devices within that same network
Public IP Address
  • Wider internet
  • All information searched will be found
&Note- each device within same network has a unique private IP address&

Packet and Frames
    Packet
  • It routes data
  • It is a chunk of data being transmitted, source and destination IP address to it.
  • It includes actual data being transmitted, source and destination IP address.
  • Used for communication between different networks.
    Frames
  •   It ensure reliable communication
  •   It is a packet with the source and destination MAC addresses added to it.
  • It is used for communication within a local network
  • It contains error-checking information to detect and correct transmission error.
IP address + MAC address= Encapsulation

  •  Header is the information added to the front of the data
  • Trailer is the information added to the end of the data
Client and Server
  • Client refers to the network software on a computer that requests network resources from the server
  • Server is when a software is installed in computer and provides network to client computers.

 




Friday, 18 August 2023

A03: Digital Representation

 

ASCII (American Standard Code for Information Interchange)

  • 7-bit character code
  • values: 0-127

Representing Sound

  • For the computer to process the sound, it needs to be converted into binary.
  • Convert the captured sound unto digital signal using microphone.

Representing Number

  • In a computer system numbers are represented by a string of bits called Binary Number.

Number System


           1Decimal (Base 10) Number system

  • 10 symbols: 0-9
  • Uses positional notational

  • 2. Binary (Base 2) Number system

  • Binary number system has two symbols: 0 and 1, thus the base used is 2

    Decimal to binary: Divide the number repeatedly by 2 until we get '0' as the quotient and remainders are written in reverse.

    Example:

    (23)10= ()2

    23/2=11 r:1

    11/2=5 r:1           Read from below          

    5/2=2 r:1              10111

    2/2=1 r:0

    0/2=0 r:1

    (23)10= (10111)2

    Binary to decimal (Use the weighted sum method)

    Example:

    (10111)= ( )10

    =1*24+1*22+1*21+1*20

    =16+4+2+1

    =23

    (10111)= (23)10

    3. Hexadecimal (Base 16) Number System

  • Uses 16 symbols: 0-9,A-F

  • 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

    Hexadecimal to Binary

    Example:

    (56)16= (01010110)2

    Binary to hexadecimal

    Divide the bits into 4

    (01010110)2= ()16

    0101                ]     0110

    =1*22+1*20                =1*2+ 1*21

    =4+1                    =4+2

    =5                          =6

    (111000)= (56)16

    Hexadecimal to decimal

    (56)16= ()10

    5*161+ 6*160

    80+6

    86

    (56)16= (86)10

    Decimal to hexadecimal

    Convert the decimal into binary and then convert to hexadecimal

    (86)10= ()2

    86/2=43 r:0

    43/2=21 r:1

    21/2=10 r:1             read from below:

    10/2=5 r:0               1010110

    5/2=2 r:1

    2/2=1 r=0

    0/2=0 r=1

    (86)10= (1010110)2

    (1010110)2= ()16

    Divide into 4bits

    101                ]     0110

    =1*4 + 1*1        =1*4+1*2

    =5                       =6

    (1010110)2= (56)16

    4. Octadecimal (Base 8) Number system

  • It uses 8 symbols: 0-7

    Octadecimal to Binary

    Example:

    (32)8= (11010)2

    Binary to Octadecimal

    Divide the bits into 3

    (11010)2= ()8

    010           ]     11

    =1*2            =1*2+ 1*20

    =2                   =2+1

                            =3

    (11010)2= (32)8

     

    Octadecimal to decimal

    (32)8= ()10

    =3*81+ 2*80

    =24+2

    =26

    (32)8= (26)10

     

    Decimal to Octadecimal

    Convert the decimal into binary and then convert to Octadecimal

    (26)10= ()2

    26/2=13 r:0

    13/2=6 r:1

    6/2=3 r:0                  read from below:

    3/2=1 r:1                  11010

    0/2=2 r:1

    (26)10= (11010)2

     

    (11010)2= ()8

    Divide into 3bits

        11           ]         010

    =1*21+1*2       =1*21

    =3                        =2

    (1010110)2= (32)8



Number Representation- Unsigned
  • If there are N bits in the binary number, the range of the number is: 0- 2N-1



Number Representation- Signed

  • The leftmost bit is used to indicate the sign:
    • 0 for positive
    • 1 for negative
  • Positive values have identical representation in all system.
  • Negative Number have different representations
    • Sign-and-magnitude
    • 1's-complement
    • 2's-complement
  • 1's-complement
    • Negative values are obtained by complementing each bit of the corresponding positive number.



  • 2's-complement
    • obtain by forming bit complement of the number, then add 1



    • It is the most efficient way to carry out addition and subtraction operations.
  • Addition
    • Rules:
      • 0+0=0
      • 1+0=1
      • 1+1=10 (binary for 2)
      • 1+1+1=11 (binary for 3)



  • Subtraction
    • Rules:
      • 0-0=0
      • 1-0=1
      • 1-1=0
      • 0-1=1 (Borrow 1)
    • For subtraction, first we convert it to addition by changing the signs of the bits.

  • Range: -2n-1 to 2n-1-1
    • 4bits: -8 to +7

  • Overflow
    • It occurs when the answer doesn't fit in the range given
    • Overflow occurs when 2's-complementary numbers of same sign are added and the result has the opposite sign.
      • (+A) + (+B) = -C
      • (-A) + (-B)= +C



  • Sign Extension
    • If it is a positive bit numbers add zero in the front
      • Ex: 001 can be written in five bits by adding 2 zeros in the front i.e., 00001
    • If it is a negative bit numbers add one in the front
      • Ex: 101 can be written in five bits by adding 2 ones in the front i.e., 11101
  • Character Representation
    • It uses 7-bit codes

Sunday, 13 August 2023

A02: Fetch, Execution and IO

 The Data is Stored in BITS 

  • Bits are the smallest unit data measurement.
  • The bits are stored in binary code (0s and 1s). 
  • 8 bits makes 1 byte.
  • 1 is shown in presence of light and 0 in absence of light.
  • Functional Unit-

              1. Primary memory or Main memory

    • Representation: 2^n (where n= length of the bit and base is used 2 due to usage of binary codes).

      2. Cache Memory

    • CPU directly interacts with it.
    • Access time is more faster in cache memory than in main memory.
    • It is of level (example, L1, L2, L3...) and as level of cache increases the size increases and accessibility time decreases. 

      3. Register
    • Data are frequently executed.
    • Accessibility time is faster than the upper two memories.

    Processor 
    Arithmetic and Logic Unit : Performs arithmetic and logic operations
    Control Unit: Coordinates the operations in memory, ALU and I/O units

    Instruction Cycle/ Machine Cycle
    • Single cycle of operation
    • Operations-
      1. Fetch instruction from register
      2. Decode the instruction
      3. Execute instruction (In ALU)
      4. Store or rewrite the result














    Instructions and Programs
    • Instruction specifies operation and location of the data.
    • The sequence of instructions executed one after another is called program.
    • Both instruction and programs are stored in main memory.
    • Three instruction types:
      1. Load- input devices into processor
      2. Store- register to memory
      3. Operator- performs the result
    Processor Component
    • Program Counter (PC): Holds the memory address of next instruction
    • Instruction register (IR): Holds the current instruction
    • General purpose register holds data and addresses.
    Handling I/O devices
    • Read data
    • Write data
    • I/O device performs transfer

    Programs can be executed quickly by increasing the speed of electronic circuits in processor, decreasing the accessing time in cache and RAM, designing the instruction set (set of instruction understood by the CPU) and through parallelism.

    Technology
    • The improvement in materials whereby instructions can be executed faster.
    • More logic functionality and more storage capacity.
    Parallelism 
    • It has multicore processor which increases the performance.

    A01: Basic Structure of Computer

     Basic Structure of Computers


    • Computer 
      • It is any electronic device that takes in input, process it and gives out an output. A calculator can also be a simple computer.
      • It has three main components; Input devices, Central processing unit and output devices.
      • Input components include keyboards, microphone, USB ports, etc.
      • Output components include screen, printer, network cards, etc.



    • CPU: Central Processing Unit
      • It executes the instruction from computer program.
      • It is composed of two or more processor called cores. Multicore CPUs enable computer to carryout instruction simultaneously.
    • Storage Components
      • The more storage the better the performance of the computer.
      • There are two types:
        1. Short-term storage(volatile storage): RAM (Random Access Memory) also known as working storage is crucial for computers to work efficiently. Virtual memory is a part of hard disk where less used data are stored.
        2. Long-term storage(non-volatile storage):  It is used to store documents and multimedia files. Hard disk, USB flash drives are long-term storage.
    • Personal Computer Hardware
      • There are four major PC computer:
        1. Motherboard: It is a main circuit board inside the computer connecting all the hardware components. It makes the house to CPU, RAM, expansion slots and various connectors.
          •  Computer Bus Fundamentals
            • Bus is a collection of wires which transports signal from one part to another part.
            • It is of three types:
              1. Data Bus- Carries signal from RAM to CPU and vice versa/ carries data to be stored.
              2. Address Bus- gives location to where the data should be stored.
              3. Control Bus- Used to carry signal from CPU to memo
               I/O Polling and Interrupt
            • In polling the CPU checks I/O devices at regular to see whether the computer needs any service while in interrupt method, the I/O devices interrupts the processor and reminds/alerts it that computer needs service.
        2. Hard Drive Fundamental
          • Primary long-term storage
          • Consists of magnetic disk called 'magnetic platters'.
          • It stores document and application.
          • Solid State Drives (SSD) are used due to speed and reliability. It is more expensive than hard drives.
        3. RAM fundamental
          • Main short-term storage
          • It has no moving parts so accessing data in RAM is faster than in hard disk.
        4. BIOS/CMOS Fundamental
          • BIOs is the basic I/O system
          • It is a set of instruction (performs POST-power-on self test) located in a chip on the mother board.
          • Complementary metal-oxide-semiconductor (CMOS) is a small amount of memory on a computer to store BIOS setting.
    • To boot a computer, an operating system(OS) is required. OS is a software installed in hard drives that enables the computer's hardware to communicate and operate with the computer's software.





    G01:Client Server Architecture

      G01 Client Server Architecture A central server (host computer) serves as both the source of service requests and the destination for ...