Pixels

  • A pixel is the smallest unit of a digital image or graphic that can be displayed and represented on a digital display device.
  • A pixel is also known as a picture element.
  • A pixel is represented by a dot or square on a computer monitor display screen. 
  • Pixels are combined to form a complete image, video, text or any visible thing on a computer display.


  • The physical size of a pixel depends on how we have set the resolution of the display screen.


 What is Sub-Pixel:
  • Each pixel actually composed of three dots a Red, Green, Blue. The three dots must converge at the same point for the image to be sharp, if not the image will be fuzzy.
  • Each pixel can have typically three dimensions of variability as Red, Green, Blue. Depending on the intensity of  RGB different colors are produced.
 Example:



Skewing

  •  Skewing is a process of changing direction or position of image.
  •  It turns the image at an angle and can be done in positive and negative direction.


 How to Apply Skewing:
  • In MS Paint, open image that you want to skew. Click on Resize.


  •   Now enter value either in Horizontal or Vertical.


  • It appears as below:




Aspect Ratio

  • Aspect ratio specifies the ratio of width to the height. Video, still pictures and the devices used to display this have the aspect ratio like 3:2, 4:3, 16:9....
  • The number before the colon represents the width and the number after the colon represents height.


 Images on Screen with Different Aspect Ratio:
  • Black bars appear when the aspect ratio of the content playing isn't matched with the aspect ratio of screen.
  •  Depending on the type of mismatch between the picture and the display's ratio, the black bars appear in different places. 
  • Content wider than the screen it is played on will have horizontal black bars, while content that is taller will use vertical bars.

 Examples:






Resolution

  • Number of pixels per one square inch is called resolution
  • Measured by number of pixels in horizontal by number of pixels in vertical.
  • Units are pixels per inch.
  • When resolution increases, images become crisper due to a higher pixel density. 
  • In fact, text and images may also become smaller because more pixels per square inch are being displayed.
  • For example, going from just 800x600 to 1024x768 would increase the total number of pixels by 306,432. Those extra pixels are added to the screen with the same amount of text, thus making the text appear smaller.
  • When resolution decreases text should appear bigger, images are not as crisp, and performance requirements go down.



  • If two different sized screens have same resolution, image looks bigger in the wider screen, remaining everything is same.


 Examples:
  • Most of monitors have 1920 x 1080 resolution.


  • Our mobile phones have resolution 720 x 1280 in common. Depending on the type of mobile, it changes.


  • We normally adjusts the quality stream of video in Youtube.





Operator Precedence


  • When several operations occur in an expression, each part is evaluated and resolved in a predetermined order called operator precedence. 
  • Parentheses can be used to override the order of precedence and force some parts of an expression to be evaluated before other parts.
  •  Operations within parentheses are always performed before those outside. Within parentheses, however, normal operator precedence is maintained.
  • When expressions contain operators from more than one category, arithmetic operators are evaluated first, comparison operators are evaluated next, and logical operators are evaluated last.
  •  Comparison operators all have equal precedence i.e., they are evaluated in the left-to-right order in which they appear.
  •  Arithmetic and logical operators are evaluated in the following order of precedence.

ARITHMETIC OPERATORS COMPARISON OPERATORS LOGICAL OPERATORS
Exponent(^) Equality(=) Not
Negation(-) Inequality(<>) And
Multiplication and Division(*,/) Less than(<) Or
Integer division(\) Greater than(>) Xor
Modulus arithmetic(Mod) Less than or equal to (<=) Eqv>
Addition and Subtraction(+,-) Greater than or equal to(>=) Imp
String Concatenation(&) Is &

  • When multiplication and division occur together in an expression, each operation is evaluated as it occurs from left to right. 
  • Likewise, when addition and subtraction occur together in an expression, each operation is evaluated in order of appearance from left to right.
  • The string concatenation operator(&) is not an arithmetic operator, but in precedence it does fall after all arithmetic operators and before all comparison operators. 
  • The Is operator is an object reference comparison operator. It does not compare objects or their values, it checks only to determine if two object references refer to the same object.
 Examples:






Logic Gates


  • These are elementary building blocks of digital circuit.
  • It has one or more inputs and only one output..
  • Output is active only for certain input combinations.
  • Common Logic gates are AND, OR, NAND, NOR.
 1. AND Gate:
  • The AND gate is an electronic circuit that gives a high output (1) only all inputs give are high.
 Logic Diagram:


 Truth Table:


 2. OR Gate:
  • The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high.
 Logic Diagram:


 Truth Table:


 3. NAND Gate:
  • NAND gate is a electronic circuit that gives a low output (0), if two inputs are high.
  • Works in the opposite function of AND gate.
 Logic Diagram:


 Truth Table:


 4. NOR Gate:
  • NOR gate is a electronic circuit that gives a high output (1), if two inputs are low.
  • Works in the opposite function of OR gate.
 Logic Diagram:


 Truth Table:




Parity Bit

  • Parity bit is also called Check bit.
  • Added to block of data for error detection purpose.
  • Used in data transmission to ensure total number of 1's is even or odd.
  • Purpose is to ensure data is not corrupted during transmission.
 Types of Parity:
 1. Even Parity:
  • Parity bit is added to the transmitted binary code, then total ones in transmitted binary code includes parity bit is even is called even parity.
  • Due to noise disturbance(error) even parity converted into odd parity.  


 2. Odd Parity:
  • Parity bit is added to the transmitted binary code, then total ones in transmitted binary code includes parity bit is odd is called even parity.
  • Due to noise disturbance(error) odd parity converted into even parity.


 Advantages:
  • Errors on a noisy line can be find quickly.
 Disadvantages:
  • It detects only single bit error.
  • Not able to correct the error data