Showing posts with label Nagarjuna College. Show all posts
Showing posts with label Nagarjuna College. Show all posts
C Program for Least Square Method (Regression Analysis)
#include<stdio.h>
#include<conio.h>
void main()
{
float x[100],y[100],sumx=0,sumx2=0,sumy=0,sumyx=0,b,a;
int i,n;
printf("Enter n: ");
scanf("%d",&n);
printf("Enter the values:\n");
for(i=0;i<n;i++)
{
printf("Enter x[%d] and y[%d]: ",i,i);
scanf("%f%f",&x[i],&y[i]);
}
for(i=0;i<n;i++)
{
sumx=sumx+x[i];
sumx2=sumx2+x[i]*x[i];
sumy=sumy+y[i];
sumyx=sumyx+y[i]*x[i];
}
//for y=ax+b
b=(sumx2*sumy-sumyx*sumx)/(n*sumx2-sumx*sumx);
a=(n*sumyx-sumx*sumy)/(n*sumx2-sumx*sumx);
printf("\nHence, the required eqn is y = %fx + %f",a,b);
getch();
}
OUTPUT:
Computer Networks (CN) LAB - Routing
Packet Tracer Intro to Routing - 1, Cisco CCNA
Packet Tracer Intro to Routing - 2, Cisco CCNA
Evolution of Microprocessor (Intel Series)
Intel 4004
- Year of introduction 1970
- 4-bit MP
- 4 KB memory
- Speed: 108 KHz
- World’s first MP
Intel 8008
- Year of introduction 1972
- 8-bit version of 4004
- 16 KB memory
- Slow
Intel 8080
- Year of introduction 1974
- 8-bit MP
- Speed: 2 MHz
- First general purpose MP used as CPU of computer
- 64 KB memory
Differences between 8085 and 8086 Microprocessor
|
8085
|
8086
|
|
8085 is 8-bit microprocessor
|
8086 is 16-bit microprocessor
|
|
8085 has 16-bit address bus
|
8086 has 20-bit address bus
|
|
Clock speed: 3 MHz
|
Clock speed can vary between 5, 8 and
10 MHz for three different MP.
|
|
8085 can access up to 2^16 = 64 KB of
memory
|
|
|
8085 doesn't have an instruction queue
|
8086 has instruction queue
|
|
8085 does not support pipelined architecture
|
8086 supports pipelined architecture.
|
|
8085 does not support multiprocessing
support
|
8086 supports
|
|
8085 can address 2^8 = 256 I/O's
|
8086 can access 2^16 = 65,536 I/O's
|
|
8085 only supports integer and
decimal
|
8086 supports integer, decimal and
ASCII arithmetic.
|
|
8085 does not support Multiplication and Division
|
8086 supports.
|
|
8085 supports only single operating
mode
|
8086 operates in two modes.
|
|
8085 requires less external hardware
|
8086 requires more external hardware.
|
|
The cost of 8085 is low.
|
The cost of 8086 is high.
|
|
In 8085, memory space is not segmented.
|
In 8086, memory space is segmented.
|
Fetch & Execute Operation: Timing Diagram
- The graphical representation of status of various signals involved during a machine cycle with respect to time is called timing diagram.
- This gives basic idea of what is happening in the system when the instruction is getting fetched and executed, at what instant which signal is getting activated.
- The signals involved during machine cycle are CLK, A15 – A8, AD7 – AD0, IO/M(bar), RD(bar), WR(bar) and S1, S0.
|
IO/M(bar)
|
S1
|
S0
|
Operation
|
|
0
|
0
|
0
|
Halt
|
|
0
|
0
|
1
|
Memory write
|
|
0
|
1
|
0
|
Memory read
|
|
0
|
1
|
1
|
Op-code fetch
|
|
1
|
0
|
1
|
IO write
|
|
1
|
1
|
0
|
IO read
|
|
1
|
1
|
1
|
Interrupt acknowledge
|
Machine Cycles of 8085 microprocessor
1. Op-code fetch cycle
- The MP uses this cycle to take the op-code of an instruction from the memory location to processor.
- The op-code is taken from memory and transferred to instruction register for decoding and execution.
- The time required to complete this cycle is 4 to 6 T-states.
2. Memory read cycle
- The MP executes these cycles to read data from memory.
- The address of memory location is given by instruction.
- The time required to complete the memory read cycle is 3 T-states.
PROGRAM TO COUNT NUMBER OF 1s IN REGISTER A
MVI C,00H ;COUNTER
FOR 1
MVI B, 8 ;DOWN
COUNTER
;FOR
8-BIT REGISTER A
UP: RAL
JNC PASS
INR C
PASS: DCR B
JNZ UP
HLT
ADDITION OF FIRST 10 NATURAL NUMBERS
;TITLE SUM OF FIRST 10 NATURAL NUMBERS
MVI D,1 ;DATA
MVI A,0 ;SUM
MVI C,10 ;COUNTER
AGAIN: ADD D
INR D
DCR C ;COUNTER CHECK
JNZ AGAIN
STA 0000H ;STORE
THE SUM AT 0000H ADDRESS.
HLTMicroprocessor Viva Questions
Introduction to Microprocessor and Microcomputers
1. Define microprocessor.
2. Write application of microcontroller.
3. List the basic components of microcomputer.
4. What are the purposes of control unit in Microprocessor?
5. Mention one advantage and one disadvantage of Harvard architecture over von Neumann machine.
6. What is store programmed concept.
2. Write application of microcontroller.
3. List the basic components of microcomputer.
4. What are the purposes of control unit in Microprocessor?
5. Mention one advantage and one disadvantage of Harvard architecture over von Neumann machine.
6. What is store programmed concept.
8086/8088 Architecture and Instruction Set
1. How many address and data bus are available in 8088 microprocessor?
2. How many minimum address lines are required to access 512 KB?
3. Explain in brief about how microprocessor works.
4. What is segment register in 8086? Explain its function.
5. With an example, explain the Register Indirect Addressing Mode.
6. Write an instruction for the direct addressing mode.
7. Identify the addressing mode of source operand in MOV AL, 23H. Give reason.
8. What happens when MUL BX instruction is executed?
9. What is the total memory capacity of the system with 20 address lines?
10. What is the result of MUL AL? Initial value of AL = 03H.
11. What happens when DIV BL executed.
12. What happens when DIV BX executed.
13. How many byte instruction is MOV AX,2304H?
14. How many byte instruction is MOV AL,23H?
15. Flag Register
16. BIU, EU, CS, DS, ES, SS, IP, AX, BX, CX, DX, SP, BP, SI, DI
17. What is opcode and operand?
18. Differentiate mov ax,2304h and mov ax,[2304h].
19. Differentiate mov ax,bx and mov ax,[bx].
2. How many minimum address lines are required to access 512 KB?
3. Explain in brief about how microprocessor works.
4. What is segment register in 8086? Explain its function.
5. With an example, explain the Register Indirect Addressing Mode.
6. Write an instruction for the direct addressing mode.
7. Identify the addressing mode of source operand in MOV AL, 23H. Give reason.
8. What happens when MUL BX instruction is executed?
9. What is the total memory capacity of the system with 20 address lines?
10. What is the result of MUL AL? Initial value of AL = 03H.
11. What happens when DIV BL executed.
12. What happens when DIV BX executed.
13. How many byte instruction is MOV AX,2304H?
14. How many byte instruction is MOV AL,23H?
15. Flag Register
OF
|
DF
|
IF
|
TF
|
SF
|
ZF
|
AF
|
PF
|
CF
|
17. What is opcode and operand?
18. Differentiate mov ax,2304h and mov ax,[2304h].
19. Differentiate mov ax,bx and mov ax,[bx].
Microprocessor Viva Questions
1. What are the purposes of control unit in Microprocessor?
2. Write application of microcontroller.
3. What do you mean by Interrupt vector table?
4. Write an instruction for the direct addressing mode.
5. What is the role of linker in assembly language programming?
6. Which signal is used to select Memory or I/O?
7. What are the purposes of S2, S1, S0?
8. Describe the function of 8282.
9. What are the roles of 8251 in computers?
10. How many address and data bus are available in 8088 microprocessor?
11. Explain in brief about how microprocessor works.
12. Mention one advantage and one disadvantage of Harvard architecture over von Neumann machine.
13. What is the function of a segment register in 8086?
14. What happens when the instruction TEST AL, BL is executed?
15. With an example, explain the Register Indirect Addressing Mode.
16. What is the purpose of a linker during assembly language program development?
17. What function does INT 21H perform when 0AH is loaded into AH register?
18. What is the function of the ALE signal in 8086?
19. Define maskable interrupt with an example.
20. What is the function of T pin in 8288 bus controller?
2. Write application of microcontroller.
3. What do you mean by Interrupt vector table?
4. Write an instruction for the direct addressing mode.
5. What is the role of linker in assembly language programming?
6. Which signal is used to select Memory or I/O?
7. What are the purposes of S2, S1, S0?
8. Describe the function of 8282.
9. What are the roles of 8251 in computers?
10. How many address and data bus are available in 8088 microprocessor?
11. Explain in brief about how microprocessor works.
12. Mention one advantage and one disadvantage of Harvard architecture over von Neumann machine.
13. What is the function of a segment register in 8086?
14. What happens when the instruction TEST AL, BL is executed?
15. With an example, explain the Register Indirect Addressing Mode.
16. What is the purpose of a linker during assembly language program development?
17. What function does INT 21H perform when 0AH is loaded into AH register?
18. What is the function of the ALE signal in 8086?
19. Define maskable interrupt with an example.
20. What is the function of T pin in 8288 bus controller?
Routing Protocols
Routing Information Protocol (RIP)
RIP (Routing Information Protocol) is a widely-used protocol for managing router information within a self-contained network such as a corporate local area network (LAN) or an interconnected group of such LANs. RIP is classified by the Internet Engineering Task Force (IETF) as one of several internal gateway protocols (Interior Gateway Protocol).
Using RIP, a gateway host (with a router) sends its entire routing table (which lists all the other hosts it knows about) to its closest neighbor host every 30 seconds. The neighbor host in turn will pass the information on to its next neighbor and so on until all hosts within the network have the same knowledge of routing paths, a state known as network convergence. RIP uses a hop count as a way to determine network distance. (Other protocols use more sophisticated algorithms that include timing as well.) Each host with a router in the network uses the routing table information to determine the next host to route a packet to for a specified destination.
RIP is considered an effective solution for small homogeneous networks. For larger, more complicated networks, RIP's transmission of the entire routing table every 30 seconds may put a heavy amount of extra traffic in the network.
The major alternative to RIP is the Open Shortest Path First Protocol (OSPF).
Computer Organization (CO) Notes - BIM
Chapter 1 - CO - BIM - III.pdf
Chapter 2 - CO - BIM - III.pdf
Chapter 3 - CO - BIM - III.pdf
Chapter 4 - CO - BIM - III.pdf
Chapter 5 - CO - BIM - III.pdf
Chapter 6 - CO - BIM - III.pdf
Chapter 7 - CO - BIM - III.pdf
Chapter 8 - CO - BIM - III.pdf
Chapter 9 - CO- BIM - III.pdf
Chapter 10 - CO - BIM - III.pdf
Chapter 11 - CO - BIM - III.pdf
Chapter 2 - CO - BIM - III.pdf
Chapter 3 - CO - BIM - III.pdf
Chapter 4 - CO - BIM - III.pdf
Chapter 5 - CO - BIM - III.pdf
Chapter 6 - CO - BIM - III.pdf
Chapter 7 - CO - BIM - III.pdf
Chapter 8 - CO - BIM - III.pdf
Chapter 9 - CO- BIM - III.pdf
Chapter 10 - CO - BIM - III.pdf
Chapter 11 - CO - BIM - III.pdf
