Serial Parallel Protocols and proteted class - kashyapp1/github_exp GitHub Wiki

What is serial protocols?

  • Serial communication is a commonly used method with which to exchange data between computers and peripheral devices. Serial transmission between the sender and receiver are subject to strict protocols which provide security and reliability and have led to its longevity and it's examples are SPI,I2C,RS232 etc.
  • Used in shorter distances and Serial communication is the preferred method when dealing with circuits or processors with a limited number of I/O pins.

image

                              Fig.1 Working of Serial Protocols

Basic Modes of serial data transmission

  • Binary pulses are used to transmit data in serial data transmission. The binary digit one is represented by five volts or a HIGH logic. Conversely, binary zero is denoted with a logic LOW or zero volts. In order to implement serial communication, a source and destination are required. They are also referred to as the sender and receiver. Various types of serial communication can be employed and are designated as Simplex, Half Duplex, and Full Duplex

  • The Simplex method implements one-way data transmission. In this scheme, only the source or destination is active at any given time. If the source is sending data, the receiver has no choice but to accept the transmission. Simplex mode is used when broadcasting television or radio signals.

  • Half Duplex mode permits the source and destination to both be active, but not simultaneously. Transmission only occurs in one direction at a time. A case in point can be seen when using the Internet. When you make a request from your computer for a webpage, the server processes the request. It then becomes the sender when returning the information to your computer, which is now the receiver.

  • Full Duplex mode is the world’s most widely used form of serial communication. Source and destination are both active and can send and receive data simultaneously. Your smartphone is a prime example of full duplex mode in action.

What is parallel protocols?

  • More I/O lines are needed to implement parallel communication. When data is sent in a block of 8,16 or 32 bits, each bit needs its own physical I/O line. The speed of parallel transfer is faster than serial transmission but needs a larger number of I/O lines. Parallel data transfer is used in personal computers to exchange data with internal components such as the random access memory (RAM) or the CPU.

image

                            Fig.2 Working of Parallel Protocols

Difference between Serial and Parallel Protocols:

Serial Bus Parallel Bus
Sends one data bit at each clock pulse Transfers a block of data at a simultaneously
Better method for long distance communication Mostly used for short distance communication
Slow transmission speed Faster speed of communication
Requires a single wire for data transmission Requires ‘n’ number of lines for transmitting ‘n’ bits
Low installation cost Higher installation cost
Example: Computer to Computer Example: Computer to multifunction printer

Serial protocol divided into two types:

  • Serial synchronous protocol
  • Serial asynchronous protocol

Serial synchronous protocol - SPI protocol

  • Used for longer distance
  • Communication done with outside chip.
  • Master and slave have different clocks because both are working in different chip.

Limitation

  • serial synchronous protocol cannot be used for more distance.

Serial asynchronous protocol - UART

  • UART communication happens between single line.
  • Full duplex communication
  • UART has start bit and stop bit to indicate when the data transfer done.
  • High speed communication protocol
  • If distance is more, data loss may happen.
  • UART uses 128B/130B encoding for data transmission

Parallel Protocol

  • Parallel Synchronous protocol
  • Parallel Asynchronous protocol

Parallel Synchronous protocol - APB Protocol

  • Half duplex communication
  • Working on system clock

Parallel Asynchronous protocol - AXI protocol

  • Burst based transaction
  • Full duplex Communication

  1. Protected variables can be get by other classes.

Protected variables can be assessed by using set() and get() method. In parent class protected (variable) should set.(variable) and we can access that variable in child class using get.(variable).

Example:

   class fruit;  
   rand apple;  
   rand orange;  
   protected a = tomato;  
   set.(a);  
   endclass  

   class dryfruits extend fruit;
   get.(a);
   endclass