Wednesday, September 10, 2014

1.3.1 NUMBER SYSTEM CONVERSIONS

Decimal Number System to Other Base System(s)

Steps
  • Step 1 - Divide the decimal number by the value of the new base.
  • Step 2 – Write the remainder at the right-most position.
  • Step 3 – Repeat the process of dividing, until the quotient is 0, and keep writing the remainder after each step of division.
  • Step 4 – Write the remainder(s) in reverse order.

 Q: Convert (29)10 into Binary Number System

Binary Number System has base 2

Operation
Quotient
Remainder
29 / 2
14
1
14 / 2
7
0
7 / 2
3
1
3 / 2
1
1
1 / 2
0
1

Thus, (29)10 = (11101)2

 
Q: Convert (29)10 into Octal Number System

Binary Number System has base 8

Operation
Quotient
Remainder
29 / 8
3
5
3 / 8
0
3

Thus, (29)10 = (35)8
 

Q: Convert (29)10 into Hexadecimal Number System

Binary Number System has base 16

Operation
Quotient
Remainder
29 / 16
1
13 (D)
1 / 16
0
1

Thus, (29)10 = (1D)16

 

For Fractions
Steps
  • Step 1 – Multiply the decimal fraction by the value of new base.
  • Step 2 – If a non-zero integer is generated, record the non-zero integer otherwise record 0.
  • Step 3 – Remove the non-zero integer and repeat the above steps till the fraction value becomes 0.
  • Step 4 – Write down the number according to occurrence.

Q: Convert (0.75)10 into Binary Number System

Binary Number System has base 2

Operation
Value
Non-fractional Part
0.75 * 2
1.50
1
0.5 * 2
1.00
1

 Thus, (0.75)10 = (0.11)2

 
Q: Convert (0.75)10 into Octal Number System

Binary Number System has base 8

Operation
Value
Non-fractional Part
0.75 * 8
6.00
6

 Thus, (0.75)10 = (0.6)8
 

Q: Convert (0.75)10 into Hexadecimal Number System

Binary Number System has base 16

Operation
Value
Non-fractional Part
0.75 * 16
12.00
12 (C)

Thus, (0.75)10 = (0.C)16

 

Other Base System(s) to Decimal Number System

Steps
  • Step 1 – Write the weight of each bit.
  • Step 2 – Get the weighted value by multiplying the weighted position with the respective bit.
  • Step 3 – Add all the weighted value to get the decimal number.

Q: Convert (11101.11)2 into Decimal Number System

(11101.11)2
((1 x 24) + (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20) + (1 x 2 -1) + (1 x 2 -2))10
 
(16 + 8 + 4 + 0 + 1 + 0.5 + 0.25)10
 
(29.75)10

            Thus, (11101.11)2 = (29.75)10

Q: Convert (35.6)8 into Decimal Number System

(35.6)8
((3 x 81) + (5 x 80) + (6 x 8 -1) )10
 
(24 + 5 0.75)10
 
(29.75)10

Thus, (35.6)8 = (29.75)10

Q: Convert (1D.C)16 into Decimal Number System

(1D.C)16
((1 x 161) + (13 x 160) + (12 x 16 -1) )10
 
(16 + 13 + 0.75)10
 
(29.75)10

Thus, (1D.C)16 = (29.75)10

 

***Other Base System to Non-Decimal System

Steps
  • Step 1 - Convert the original number to a decimal number (base 10).
  • Step 2 - Convert the decimal number so obtained to the new base number.

 

SHORTCUT METHODS

Binary to other systems and vice-versa

a)      Binary to Octal
1.      Break the number into 3-bit sections starting from LSB to MSB (in case of fractions, from MSB to LSB).
2.      If we do not have sufficient bits in grouping of 3-bits, we add zeros to the left of MSB so that all the groups have proper 3-bit number (in case of fractions, we add trailing zeros in LSB).
3.      Write the 3-bit binary number to its octal equivalent.
e.g. (010 110 001 . 101 011)2 = (261.53)8 

And for converting from octal to binary, simply convert each octal digit into 3-bit binary equivalent.
e.g. (740.6)8 = (111 100 000 . 110)2

 

b)      Binary to Hexadecimal
Here, we form the group of 4-bits.
e.g. (0011 0000 0110 . 1101)2    = (306.D)16

And for converting from hexadecimal to binary, simply convert each hexadecimal digit to its 4-bit binary equivalent.
e.g. (2C6B.F2)16 = (0010 1100 0110 1011 . 1111 0010)2

 
Octal to Hexadecimal
1.      Convert each octal digit to 3-bit binary form.
2.      Group them in 4-bit binary form by starting from LSB to MSB.
3.      Convert these 4-bit blocks into their hexadecimal symbols.
e.g. (55)8 = (101101)2 = (2D)16
 
Hexadecimal to Octal
1.      Convert each hexadecimal digit into binary form.
2.      Group them into 3-bit form.
3.      Convert the 3-bit block in octal.
e.g. (2D)16 = (00101101)2 = (55)8

Tuesday, September 9, 2014

1.3 NUMBER SYSTEM

A digital system can understand positional number system only where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number.

 A value of each digit in a number can be determined using
  • The digit
  • The position of the digit in the number
  • The base of the number system (where base is defined as the total number of digits available in the number system).

Base of a Number System: Base is the characteristic of a number system. It can be thought of as the number of objects grouped together in the system.
4 Types of Number Systems

Ø  Decimal Number System
Characteristics
·         Uses ten digits: 0,1,2,3,4,5,6,7,8,9.
·         Also called base 10 number system
·         Each position represents a specific power of the base (10). For example, the decimal number 1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in the hundreds position, and 1 in the thousands position.

Ø  Binary Number System
Characteristics
·         Uses two digits: 0 and 1.
·         Also called base 2 number system

Ø  Octal Number System
Characteristics
·         Uses eight digits: 0,1,2,3,4,5,6,7.
·         Also called base 8 number system

Ø  Hexadecimal Number System
Characteristics
·         Uses 10 digits and 6 letters: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
·         Letters represents numbers starting from 10.
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
·         Also called base 16 number system

 

1.2.4 ANDROID Operating System

One of the most widely used mobile OS these days is ANDROID. Android is a software bunch comprising not only operating system but also middleware and key applications. Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich Miner, Nick Sears and Chris White in 2003. Later Android Inc. was acquired by Google in 2005. After original release there have been number of updates in the original version of Android.

ANDROID VERSIONS

Android Beta
ü  First Version of Android.
ü  The focus of Android beta is testing incorporating  usability.
ü  Android beta will generally have many more problems on speed and performance.

Android Astro 1.0
ü  First full version of android.
ü  Released on September 23, 2008.
ü  Wi-Fi and Bluetooth support.
ü  Quite slow in operating.
ü  Copy and paste feature in the web browser is not present.

Android Cupcake 1.5
ü  Released on April 30, 2009.
ü  Added auto-rotation option.
ü  Copy and Paste feature added in the web browser.
ü  Increased speed and performance but not upto required level.

Android Donut 1.6
ü  Released on September 15, 2009.
ü  Voice search and Search box were added.
ü  Faster OS boot times and fast web browsing experience.
ü  Typing is quite slower.

Android Éclair 2.0/2.1
ü  Released on October 26, 2009.
ü  Bluetooth 2.1 support.
ü  Improved typing speed on virtual keyboard, with smarter dictionary.
ü  No Adobe flash media support.

Android Froyo 2.2
ü  Released on  May 20, 2010.
ü  Support for Adobe Flash 10.1
ü  Improved Application launcher with better browser
ü  No internet calling.

Android Gingerbread 2.3
ü  Released on  December 6, 2010.
ü  Updated User Interface with high efficiency and speed
ü  Internet calling
ü  One touch word selection and copy/paste.
ü  New keyboard for faster word input.
ü  More successful version of Android than previous versions.
ü  Not supports multi-core processors.

Android Honeycomb 3.0
ü  Released on February 22, 2011.
ü  Support for multi-core processors
ü  Ability to encrypt all user data.
ü  This version of android is only available for tablets.

Android IceCreamSandwich(ICS) 4.0
ü  Released on November 14, 2011.
ü  Virtual button in the UI.
ü  A new typeface family for the UI, Roboto.
ü  Ability to shut down apps that are using data in the background.

Android JellyBean 4.1
ü  Released on June 27, 2012.
ü  Latest version of Android.
ü  Smoother user interface.


Features & Specifications

Android is a powerful Operating System supporting a large number of applications in Smart Phones. These applications make life more comfortable and advanced for the users. Hardware that support Android are mainly based on ARM architecture platform. Some of the current features and specifications of android are:

Android is a Linux-based open source software stack  that comes along with operating system , middleware, native mobile applications, along with set of API libraries for building third party applications. It was designed primarily for touchscreen mobile devices such as smartphones, tablets and now its focus has spread wider across other embedded systems. Initially developed by Android Inc.,(founded in 2003 and is based in Palo Alto, California) which operated as subsidiary of Google and later purchased by Google in 2005.
Android was publically announced in 2007 and first phone was sold on October 2008.
 
 

Fig 37: Framework of Android Operating System
Android applications are written in java programming language. Android is available as open source for developers to develop applications which can be further used for selling in android market. There are around 200000 applications developed for android with over 3 billion+ downloads. Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. For software development, Android provides Android SDK (Software development kit).
 
Applications
These are the basics of Android applications:
•      Android applications are composed of one or more application components (activities, services, content providers, and broadcast receivers)
•      Each component performs a different role in the overall application behavior, and each one can be activated individually (even by other applications)
•      The manifest file must declare all components in the application and should also declare all application requirements, such as the minimum version of Android required and any hardware configurations required
•      Non-code application resources (images, strings, layout files, etc.) should include alternatives for different device configurations (such as different strings for different languages)
 



1.2.3 LINUX Operating System

Linux is one of popular version of UNIX operating System. It is open source as its source code is freely available. It is free to use. Linux was designed considering UNIX compatibility. It's functionality list is quite similar to that of UNIX.

Components of Linux System
Linux Operating System has primarily three components

  • Kernel - Kernel is the core part of Linux. It is responsible for all major activities of this operating system. It is consists of various modules and it interacts directly with the underlying hardware. Kernel provides the required abstraction to hide low level hardware details to system or application programs.
  • System Library - System libraries are special functions or programs using which application programs or system utilities accesses Kernel's features. These libraries implements most of the functionalities of the operating system and do not requires kernel module's code access rights.
  • System Utility - System Utility programs are responsible to do specialized, individual level tasks.

Fig 35: Components of Linux OS

Kernel Mode vs User Mode
Kernel component code executes in a special privileged mode called kernel mode with full access to all resources of the computer. This code represents a single process, executes in single address space and do not require any context switch and hence is very efficient and fast. Kernel runs each processes and provides system services to processes, provides protected access to hardwares to processes.

Support code which is not required to run in kernel mode is in System Library. User programs and other system programs works in User Mode which has no access to system hardwares and kernel code. User programs/ utilities use System libraries to access Kernel functions to get system's low level tasks.

Basic Features
Following are some of the important features of Linux Operating System.

  • Portable - Portability means softwares can works on different types of hardware in same way. Linux kernel and application programs supports their installation on any kind of hardware platform.
  • Open Source - Linux source code is freely available and it is community based development project. Multiple teams works in collaboration to enhance the capability of Linux operating system and it is continuously evolving.
  • Multi-User - Linux is a multiuser system means multiple users can access system resources like memory/ ram/ application programs at same time.
  • Multiprogramming - Linux is a multiprogramming system means multiple applications can run at same time.
  • Hierarchical File System - Linux provides a standard file structure in which system files/ user files are arranged.
  • Shell - Linux provides a special interpreter program which can be used to execute commands of the operating system. It can be used to do various types of operations, call application programs etc.
  • Security - Linux provides user security using authentication features like password protection/ controlled access to specific files/ encryption of data.

Architecture

                                                       Fig 36: Architecture of Linux OS

 Linux System Architecture is consists of following layers

  • Hardware layer - Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).
  • Kernel - Core component of Operating System, interacts directly with hardware, provides low level services to upper layer components.
  • Shell - An interface to kernel, hiding complexity of kernel's functions from users. Takes commands from user and executes kernel's functions.
  • Utilities - Utility programs giving user most of the functionalities of an operating systems.

LINUX COMMANDS
Common Commands
  1. mkdir - make directories
  2. cd - change directories
  3. pwd - prints the name of the current working directory
  4. cp - copy files and directories
  5. mv - move(or rename) files
  6. echo - displays a line of text
  7. sort - sort lines of text files
  8. password - update a user's authentication token(s)
  9. who - show who is logged on
  10. kill - to kill a process (using signal mechanism)