Pages

Saturday, March 19, 2011

Microprocessor (Chapter-3)


8086 Architecture : The 8086 microprocessor is divided internally into two separate units. There are bus interface Unit (BIU) and the Execution Unit. The two units function independently. The BIU fetches instructions reads operands and writes results on the other hand the EU executes instructions that have already been fetched by the BIU
Executions Unit: The propose of execution unit (EU) is to execute instructions. It contains a circuit called the arithmetic and logic unit ALU. The ALU can perform arithmetic (+ - X /) and logic (and, or, xor) etc operations. The data for the operations are stored in circuits called registers. The EU has eight registers for storing data such as AX BX CX DX SI DI SP & BP.

Bus interface Unit: The BIU facilitates communication between the EU and the memory or I/O circuits. It is responsible for transmitting address. Data and control signals on the buses. It registers are named CS DS ES SS and IP. The BIU and EU are connected by an internal bus and they work together.

Real Mode Memory Addressing: The 80286 and above operate in either the real or protected mode. Only the 8086 and 8088 operate exclusively in the real mode. Real mode operation allows the microprocessor to address only the 1mb of memory space which is known as real memory or conventional memory.

8086 Addressing Mode: The 8086 has 12 addressing modes. These modes can be classified into five groups:

1. Resister and immediate modes
2. memory addressing modes
3. Port addressing mode
4. Relative addressing modes
5. Implied addressing modes


Microprocessor (Chapter-2)



Basic Block of Microcomputer 

A microprocessor has three basic blocks : A central processing Unit, 2: A Memory Unit and 3: A  I/O Input Output Unit .

Central processing Unit: The cpu executes all the instructions. The cpu of the computer is called the microprocessor.

Memory unit: The memory unit stores both data and instruction. The memory section typically contains ROM and RAM chips.

Input Output: An I/O transfer data between the microcomputer and the external device. The transfer involves data status and control signals.

Micro computer bus: The microcomputer bus contains three busses. Which carry all the address data and control information involved in program execution.
Address bus
Data bus
Control Bus
 
Address Bus : Address Bus is unidirectional information transfer takes place in only one direction, from the microprocessor to the memory or I/O elements. Fro 8-bit
Microprocessor, this bus typically 16 bits long, The CPU can generate 2 16 = 65,536
Different possible address,

Data Bus : In this bus data can flow in both direction to or from the microprocessor. Therefore this is a bi-directional bus
Control Bus: This bus consist of a number of signals that are used to synchronize the operations of the individual microcomputer elements, the microprocessor sends some of these control signals to the other elements to indicate the type of operation being performed.

Clock Signal: The system clock signal are continued in the control bus, these signals generate the appropriate  clock periods during which instruction are carried out by the microprocessor the clock signals vary from one microprocessor to another.   

Resisters of Microprocessor: While number, size and types of registers vary from one microprocessor to another the various registers in all microprocessors carry out similar operations, the most basic types of microprocessor register are as follows:

Instruction register (IR): The instruction register store an instruction. The content of an instruction register are always decoded by the microprocessor as an instruction,

Program counter: The program counter contains the address of the instruction or operation code, The PC usually points to the next location, that is it normally contains the address of the next instruction to be execute,

Memory address register : The memory address register  or data counter contains the address of data. The microprocessor uses the address which is stored in the memory address register, as a direct pointer to memory.

 General Purpose Register: The 8086 microprocessor uses four general propose registers of data register. They are as follows

AH
AL
AX
AX (Accumulator) Register: AX is the preferred register to use in arithmetic logic and data transfer instructions because its use generates the shortest machine code, In multiplication and division operations one of the numbers involved must be in AX or AL . Input and out put operations also require the use of AL/AH/AX.

BX (BASE) Register: BX also serves as an address register an example is a table look up instruction called XLAT it is also useful in case of string operation.

CX Counter Register: program loop constructions are facilitated by the use of CX, which serves ad a loop counter, CL is used instructions that shift and rotate bits.

DX Data Register : DX is used in multiplication and division it is also used in I/O operations,

Segment register: segment registers generate memory address when combined with other registers in the Microprocessor. There are four segment register in thr microprocessor.

CS Code segment: The code segment is a section of memory that holds the code used by the microprocessor. The code segment register defines the starting address of the section of memory holding the code.

DS Data segment : The data segment is a section of memory that contains most data used by a program. Data are accessed in the data segment by an offset address or the contents of other registers that hold the offset address.

ES Extra Segment: The extra segment is an additional data segment that is used by some of the string instruction to hold destination data.

SS Stack Register: The stack segment defines the area of memory used for the stack, the stack entry point is determined by the stack segment and stack pointer register.

FS and GS: FS and GS register are available in the 80386, 486 and Pentium through Pentium 4 microprocessor to allow two additional memory segments for access by programs.

Pointer and index registers: Pointer and index registers unlike segment register. The pointer and index registers can be used in arithmetic and other register.

SP stack pointer register: The sp register is used in conjunction with Stack segment for accessing the stack segment, the access scheme can be defined and SS:SP.

BP Base Pointer Register: The BP register is used primarily to access data on the stack however. Unlike SP . we can use BP to access data in the other segments.

SI Source index Register: The SI register is used to point to memory locations in the data segment addresses by DS , By incrementing the contents of SI , we can easily access consecutive memory location.

DI (Destination index): The DI register performs the same function as SI. There is a class of instructions called string operations.


FLAGS REGISTER: The propose of flags register is to indicate the status of the microprocessor. It does this by the setting of individual bits called flags. There are two kinds of flags 1. status flags & 2. control flags.

Microprocessor(Chapter-1 )



Microprocessor with assembly language


Bit: A bit is the abbreviation of the term binary digit. A Binary digit can only have two values, represented by the symbols 0 and 1, whereas a decimal digit can have 10 values. Represented by the symbols 0 through 9.

Bit size: bit size is actually the number of bits which can be accessed at a time by the arithmetic circuits of microprocessor.

Representation of different Bit size:
-          A 4 bit wide memory location is often called a nibble. It is used in world’s first microprocessor the Intel 4004 introduced in 1971.
-          An 8-bit wide memory location is referred to as a byte, It is first used in intel 8008 microprocessor.
-          A 16 bit wide memory location is often called a word. It is used in 8086 and 8088 microprocessor.

Arithmetic and logic unit: An arithmetic and logic unit (ALU) is a digital circuit that performs arithmetic and logic operations. The size of alu defines the size of the microprocessor. For example: the Motorola 680000is a 16 bit microprocessor since its ALU is 16 bits wide.

Microprocessor: The microprocessor sometimes referred to as the CPU (Central Processing Unit is the controlling element in a computer system. The microprocessor controls memory and I/O through a series of connections called as buses. In general microprocessor contains the ALU. Control units and registers.

Three main task performed by microprocessor:
  1. Data transfer between itself and the memory.
  2. simple arithmetic and logic operations and
  3. Program flow via simple decisions.

Rom (Read Only memory): ROM is a storage medium for the groups if bits and its content cannot be altered once programmed, A rom is a nonvolatile storage device which means that its contents are retained in the event of a loss of power to the ROM chip. Exception-PROM,EPROM etc.

RAM ( Random access memory): RAM is a storage medium whose contents can be not only be read but also dynamically altered at specific addresses. Unlike ROM,RAM provides volatile storage i.e its contents are lost in the event of a power failure,

Register: A register is a volatile storage medium which can store a number of bits. The main characteristic of register is that, it can operate very fast.

Instruction Set: The instruction set of a microprocessor is the list of commands that the microprocessor is designed to execute.

Bus: A bus is a common group of wires that interconnect components in a computer system, A microprocessor has normally an address bus, a data bus and a control bus.

Microprocessor Programming language: MPL can be divided into three main types.

  1. Machine language: A machine language program consist of either binary or hexadecimal Operation code. Machine language is unique for each microprocessor. For example: Intel 8085 uses the code 100011102 for its addition instruction.
  2. Assembly Language: Assembly language program uses some common English-language –type statements, which is convenient to understand and focus the real world communication. It is generally composed of four filed.
I.            Label filed
II.          Instruction mnemonic or operation code field.
III.        Operand filed
IV.         Comment field.

Example- START:
MOV AX 10H: Initialize AX with 10,
INC CX : Increment CX
NOP : No Operation

  1. High Level language: High level language is a problem oriented language. The programmer does not have to know the details of the architecture of the microprocessor and instructions set.

Practical Application of microprocessor :  The application area of microprocessor is large as it is well suited to dedicated controllers, personal computers, automobiles etc.. some of them are—
i.              Furnace temperature control,
ii.             Personal computers
iii.            Real time robotic control

Friday, March 4, 2011

Virtual Private Network


    VPN means “Virtual Private Network”. A Virtual Private Network is a network that uses a public communication infrastructure over the internet. Basic diagram of Virtual Private Network is following---------------


Subnet Calculation


   Subnetting is a part of modern computer network. We know about IP address. Subnetting allows you to take one large network and break it into a brunch of smaller network. For handling or manage a large network, subnet most important. To make Subnetting we can help you by following --------------   


Wednesday, March 2, 2011

Linux tips

1. Userdefined Command
                                         
  #cd /usr/bin
  #vi thanks (a new file)
   echo “Welcome To Computer World”
    :x
    #chmod  777  thanks
    /root # thanks à (it will work)
   /root $ thanks à (it will work)

 
2. Run Script

                                K= Kill script                        
                                S = Start script
  
   Generally we work on run level 3. So, we use ntsysv command for kill or start of any service. Such as-

(i)                 #ntsysv
                      [ ] sendmail
(ii)               #cd  /etc/rc.d/rc3.d
           #mv S80Sendmail K30Sendmail
(iii)            #vi  /etc/rc.d/rc3.d/S60thanks
           ifconfig eth0 down
:x
  
(It will at the time of boot)

 #service sendmail restart
                 or
#/etc/init.d/sendmail restart

*For start/stop or restart any service:
 #/etc/init.d/(servicename) start or stop or restart


3. Fdisk-Partition table manipulation for Linux adding/removing/changing partition(s)

#fdisk 1  (show partitions of hard disk)
#df –h     (report file system disk spau uses)

* adding/removing/changing partition.

 #fdisk /dev/had or sda
  Now we will get :
           Command (m for help): m --  
                                                    Show details about some command.
 Such as- p, d, t, m, w, q, l, n etc when we have to use.
        P - for print partition
        n - for creating new partition
        d - for deleting partition
        t  - for changing a partition system ID
        m -for help
        l  - for list known partition ID/type
        q - for quit without saving change
        w - for write to the disk   (after creating or changing partition)
     
After adding/removing/changing partition(s) we have to reboot the pc and create file system and write on /etc/fstab file if required.
    
 If you create ext3/swap/fat32 partition(s), you must use following command for format partition(s)-
                 
                   #mkfs.ext3 /dev/hda n -   (linux ext3)
                  #mkswap /dev/hda n -   (linux swap)
                 #mkfs.vfat /dev/hda n -   (windows fat32)       

Note: - here nfor number of partition.          

4. Proc file system
    
      This is not a true file system, it is really an interface into the currently running kernels data structures. The proc file system is usually mounted in the /proc directory in Linux. See Cpu info, meminfo, pci etc files under the /proc directory.
         
           #cd  /proc
          #vi cpuinfo
          #vi meminfo

*Alt+Ctrl+Del:
   
    Disabling “Alt+Ctrl+Del” for rebooting you have to modify /etc/inittab file. To activate this file you have to either reboot the pc or type init q from # prompt.
       

5. Use of “alias” command
    
  Temporary:-
For current log in:
#alias n= “service xinetd restart” .
         Type any command
#n    (Now xinetd service must be restarted.)

    
 Permanently:-
     For root: -
      #vi  /root/.bashrc
           #.bashrc
           # User specific aliases and functions
           alias n= “service named restart”

         #source global definitions
     
  For user: -
           $vi /home/toy/.bashrc
                              Username 
                  #.bashrc
                  #user specific aliases and functions
                 alias n= “service httpd restart”    
                                 Type any command.
                 #source global definitions

6. Linux Rescue
  
    After setup windows Xp we cannot get Linux. In this case we have to follow the following rules. (If Linux is available in hard disk): -

   1. Boot from cd of Linux
      Boot: Linux rescue  
                    Type this
   2. next/continue/ok/yes
No
 
      except   Network configuration
      N
   
   3. #chroot /mnt/sysimage -
   4. #fdisk –l -
   5. #grub-install /dev/sda or hda  -
   6. #reboot -

 If is available whether lilo/grob is default.
File   /boot/grub/grub.conf

*If we create or delete any partition, we must get problem in Linux boot loader. In this case we have to follow the following rules: -

1.      Linux Rescue
2.      #chroot /mnt/sysimage   
3.      #fdisk -l
4.      #vi /etc/fstab
*The partition of this file should be the same as the partition number of swap in hard disk.
5.      #vi /boot/grub/grub.conf
*For this file, the partition number should be less in one number in boot loader than the partition number of “/” in hard disk.
6.      #grub-install /dev/sda or hda
                 7.  #reboot -

Saturday, February 26, 2011

Computer Network

Computer network simply referred to as a network, is a group of computers and devices interconnected by communications channels. Network facilitates communications among users and allows users to divide resources.

History

Premature networks of communicating computers incorporated the military radar system Semi-Automatic Ground Environment and its relative the commercial airline reservation system Semi-Automatic Business Research Environment, started in the late 1950.

The Advanced Research Projects Agency started funding the design of the Advanced Research Projects Agency Network (ARPANET) for the United States Department of Defense in the 1960. The ARPANET evolved into the modern Internet.

Purpose

Computer networks can be used for a multiplicity of purposes:

            1. Make easy communications. Using a network, people can communicate proficiently and easily by email, instant messaging, video conference, video telephone calls, telephone and chat rooms.

2. Allotment resource. Each computer on a network may access and use hardware resources on the network, such as printing a document on a shared network printer in a networked environment.

3. Distribution files, data, and information. Authorized user may access data and information stored on another computer on the network. The potential of providing access to data and information on shared storage devices is an important feature of many networks.
           
4. Sharing software. Users may run application programs on remote computers.
           
Network classification

Computer networks can be classified consistent with the hardware and software that is used to interconnect the individual devices in the network, such as optical fiber, Ethernet, wireless LAN, HomePNA.

Ethernet defined by IEEE 802 develop various standards and mediums that enable communication between devices. By the devices of hubs, switches, bridges, or routers. Wireless LAN technology is designed to connect through the devices without wiring. These devices use radio waves or infrared signals as a transmission medium. ITU-T G.hn technology uses existing home wiring (coaxial cable, phone lines and power lines) to create a high-speed (up to 1 Gigabit/s) local area network.