Tuesday, 21 November 2017

Visual Basic

Chapter-1 checkpoints:

  1. List five major hardware components of a computer system.
  2.  The CPU, main memory, secondary storage devices, input devices, output devises. 
  1. What is main memory? What is its purpose? 
  2. Main memory is the computers work area. This is where the computer stores a program while the program is running, as well as the data that the program is working withRAM is volatile type memory. Temporary storage 
  1. Explain why computers have both main memory and secondary storage. 
  2.  Main memory does not save information as secondary storage does. 
  1. What are two general categories of software?
  2.  Operating systems and application software. Operating system is a set of programs that manages the computers hardware devices and control their processes. Applications of ware refers to programs that make the computer useful to the user.  
  1. What is an algorithm? 
  2. An algorithm is a set of well defined steps for performing a task or solving a problem 
  1. Why were computer programming languages invented? 
  2. They were invented to ease the task. They use words instead of numbers. 
  1. What is an object? What is a control?  
  2. An object is an item in a program that contains data and has the ability to perform operations . The data that an object contains is referred to as properties or attributes. A control is a specific type of object that usually appears in a programs graphical user interface. 
  1. What does event -driven mean? 
  2. An event is an action that takes place within a program , such as clicking of a control. If you wish for a control to respond to a specific event , you must write a set of programming statements known as event handler 
  1. What is a property? 
  2. A property is simply a piece of data that determines some characteristics of the control. 
  1. Why should the programmer change the name of a control from its default name? 
  2. Controls play an active role in the applications event handlers and their names appear in the applications programming statements. 
  1. If a control has the programmer -defined name txtRadius  what type of control is it? 
  2. Text box 
  1. What is the default name given to the first Text box control created in an application? 
  2. Text box 
  1. Is txtFirst+Lastname an acceptable control name? Why or why not?   
  2. The first three letters of the name should be a lowercase prefix indicating the controls type. The first letter of each word should be capitalized.  The part of the control name that appears after the three-letter prefix should describe the controls purpose in the application 
  1. What four items should be identified when defining what a program is to do? 
  2. Clearly define what the application is to do. Purpose , Input, Process , Output 
  1. Describe the importance of good planning in the process of creating a Visual Basic application. 
  1. Clearly define what the application is to do. 
  1. Visualize the application running on the computer and design it’s user interface. 
  1. Determine the controls needed 
  1. Define the values of each controls relevant properties 
  1. Determine the event handlers and other code needed for each control  
  1. Create a flowchart or pseudo code version of the code 
  1. Check the flowchart or pseudo code for errors  
  1. Start Visual Studio and create the forms and other controls identified in step 3 
  1. Use the flowcharts or pseudo code version of the code  
  1. Check the flowchart or pseudo code for errors 
  1. Start Visual Studio and create the forms and other controls identified in Step 3 
  1. Attempt to run the application  Correct  any syntax errors found and repeat this step as many times necessary 
  1. Once all syntax errors are corrected , run the program with test data for input. Correct any runtime errors. Repeat this step as many times as necessary. 
  1. What does it mean to visualize a program running?
  2. What is the value of such an activity? To create it in your mind,  to imagine what the screen will look like and sketch the former or forms in the application 
  1. What is a flowchart?  
  2. A flowchart is a diagram that graphically depicts the flow of a method. It uses boxes and other symbols to represent each step. 
  1. What is pseudocode
  2. Pseudocode is human readable code that looks similar to programming language. 
  1. What is runtime error? 
  2. Runtime errors are mistakes that do not prevent an application from executing but cause it to produce incorrect results 
  1. What is the purpose of testing a program with sample data or input? 
  2. This step must be repeated until the program reliably produces satisfactory results. 
  1. How much testing should you perform on a new program? 
  2. Until the program reliably produces satisfactory results 
  1. Briefly describe the purpose of the Solution Explorer window. 
  2. The Solution Explorer Window is a container for holding Visual Basic projects. When you create a new VA project a new solution is automatically created to contain it. The Solution Explorer window allows you to navigate among the files in a visual Basic project 
  1. Briefly describe the purpose of the Properties window. 
  2. When you are creating a Visual Basic application you use the properties window to examine and change a controls properties 
  1. What is the difference between the too bar and the toolbox? 
  2. The toolbox is a window that allows you to select the controls that you want to use in an applications user interface. 
  1. Toolbox is a window that allows you to select the controls that you want to use in an applications user interface. A toolbar contains buttons that execute frequently used commands 
  1. What is a Tool tip?
  2.  A tool tip is a small rectangular box that pops up when you hover the mouse pointer over a button on the toolbar or in the toolbox for a few seconds. It contains a short description of the buttons purpose 

created at 21-Nov-2017                   ALL RIGHTS RESERVED ©DaniyalYounis

Tuesday, 1 August 2017

HEC to discontinue two-year bachelor’s, four-year master’s degree programmes



MARCH 18, 2017 BY DANIYAL YOUNIS




ISLAMABAD: The Higher Education Commission (HEC) has agreed upon discontinuing the two-year bachelor’s and master’s degree programmes from 2018 and 2020 onwards respectively.

In a notification issued by the HEC, it is said that it will only recognise all bachelor degrees awarded after four years or eight semesters of studies.
After implementation of notice, B.A would be equivalent to 16 years of education and M.A would be equivalent to 18 years of education.
However, the Punjab education commission has refused to obey the order.
Ever since the 18th amendment has been implemented, the authority of health and education has been transferred to the provinces. HEC cannot issue notification without the formal consent of the commission.
Stay updated with coming news.







Sunday, 16 April 2017

Assembly Language Chapter-2

CHAPTER-2

(x86 Processor Architecture)

2.1.5 Section Review



1. The central processor unit (CPU) contains registers and what other basic elements?

A      Control Unit, Arithmetic Logic Unit, and the clock.



2-The central processor unit is connected to the rest of the computer system using what three buses?
Data Bus, Control Bus, Address Bus.


3-Why does memory access take more machine cycles than register access?

Conventional memory is outside the CPU, and it responds more slowly to access requests. Registers are hard-wired inside the CPU.

4-What are the three basic steps in the instruction execution cycle?

Fetch, Decode, Execute.


5-Which two additional steps are required in the instruction execution cycle when a memory operand is used?

Fetch memory operands, store memory operands .



Section Review 2.2.5:

1-What are the x86 processor’s three basic modes of operation?

Protected Mode.

Real-address mode.

System management mode.


2- Name all eight 32-bit general-purpose registers.

EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP


3- Name all six segment registers

CS, DS, SS, ES, FS, GS





4-What special purpose does the ECX register serve?

Extended Counter Register used for loop counting.
5-Besides the stack pointer (ESP). Which other register points to variables on the stack?
EBP
6-Name at least four CPU status flags?
Carry Flag: unsigned arithmetic out of range


Overflow Flag: signed arithmetic out of range


Sign Flag: result is negative


Zero Flag: result is zero


Auxiliary Carry Flag: carry from bit 3 to bit 4


Parity Flag: sum of 1 bits is an even number


7-Which flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination?
Carry Flag


8-Which flag is set when the result of a signed arithmetic operation is either too large or too small to fit into the destination?
Overflow Flag


9-Which flag is set when an arithmetic or logical operation generates a negative result?
Sign Flag


2.4.3 Section Review1. Describe SRAM and its most common use.

SRAM stands for Static Random Access Memory, used primarily for expensive, high speed cache memory.
It does not have to be refreshed.



2. Describe VRAM.

VRAM stands for Video Random Access Memory

it holds video data,

it is dual ported

> One port allow to continusly refresh the Display

> Other port writes data to display

3. List at least two features found in the Intel P965 Express chipset.


Support for multiple USB ports, multiple PCI express slots, networking, and Intel Quiet System technology

A high definition audio chip provides digital sound capabilities



4. Name four types of RAM



  • DRAM
  • SRAM
  • VRAM
  • CMOS RAM


5. What is the purpose of the 8259A PIC controller?

The 8259A Programmable Interrupt Controller (PIC) handles external interrupts from hardware devices, such as the keyboard, system clock, and disk drives.

2.5.2 Section Review

1. Of the four levels of input/output in a computer system, which is the most universal and
portable?

Level 2 (OS) works on any computer running the same operating system. If an I/O device lacks certain capabilities, the
OS will do its best to approximate the intended result. Level 2 is not particularly fast because
each I/O call must go through several layers before it executes.

2. What characteristics distinguish BIOS-level input/output?

BIOS: The basic input–output system is a collection of low-level subroutines that communicate directly with hardware devices. The BIOS is installed by the computer’s manufacturer and
is tailored to fit the computer’s hardware. Operating systems typically communicate with
the BIOS


3. Why are device drivers necessary, given that the BIOS already has code that communicates
with the computer’s hardware?

Device drivers are programs that permit the operating system to communicate
directly with hardware devices and the system BIOS. 

device driver satisfies the request by executing code
in the device firmware that reads data in a way that is unique to the device.




2.8 Review Questions


1. In 32-bit mode, aside from the stack pointer (ESP), what other register points to variables on

the stack?

EBP Extended Base Pointer register is another register that is used to hold the variable on stack.


2. Name at least four CPU status flags.
  •  Carry
  •  Zero
  • Sign
  • Direction

3. Which flag is set when the result of an unsigned arithmetic operation is too large to fit into
the destination?
Carry Flag

4. Which flag is set when the result of a signed arithmetic operation is either too large or too
small to fit into the destination?
Over Flag

5. (True/False): When a register operand size is 32 bits and the REX prefix is used, the R8D
register is available for programs to use.


True

6. Which flag is set when an arithmetic or logical operation generates a negative result?

Sign Flag

7. Which part of the CPU performs floating-point arithmetic?

Floating Point Unit

8. On a 32-bit processor, how many bits are contained in each floating-point data register?
80 bits

9. (True/False): The x86-64 instruction set is backward-compatible with the x86 instruction set.

True

10. (True/False): In current 64-bit chip implementations, all 64 bits are used for addressing.

False

11. (True/False): The Itanium instruction set is completely different from the x86 instruction set.

True

12. (True/False): Static RAM is usually less expensive than dynamic RAM.

False

13. (True/False): The 64-bit RDI register is available when the REX prefix is used.

True

14. (True/False): In native 64-bit mode, you can use 16-bit real mode, but not the virtual-8086
mode.
False

15. (True/False): The x86-64 processors have 4 more general-purpose registers than the x86
processors.
False

16. (True/False): The 64-bit version of Microsoft Windows does not support virtual-8086 mode.

True

17. (True/False): DRAM can only be erased using ultraviolet light.

False

18. (True/False): In 64-bit mode, you can use up to eight floating-point registers.

True

19. (True/False): A bus is a plastic cable that is attached to the motherboard at both ends, but


does not sit directly on the motherboard.
False

20. (True/False): CMOS RAM is the same as static RAM, meaning that it holds its value without


any extra power or refresh cycles.
False

21. (True/False): PCI connectors are used for graphics cards and sound cards.

True

22. (True/False): The 8259A is a controller that handles external interrupts from hardware


devices.
True

23. (True/False): The acronym PCI stands for programmable component interface.

False

24. (True/False): VRAM stands for virtual random access memory.


True


25. At which level(s) can an assembly language program manipulate input/output?


Hardware, Bios and OS



26. Why do game programs often send their sound output directly to the sound card’s hardware ports.


It gives more precise control of Hardware, and execution is faster.
 

2. Others

1. What is the duration of a single clock cycle in a 3-GHz processor?


1/3GHz = 1/(3*109) = 3.3*10-10 S = 0.33 ns

2. Define pipelined execution.

Executing processor stages in parallel.


3. In a 5 -stage non-pipelined processor, how many clock cycles would it take to execute 2 instructions?

n=2 , k=5
# of cycles = k*n = 5*2 =10 cycles


4. In a 5-stage single-pipelined processor, how many clock cycles would it take to execute 8 instructions?

n=8 , k=5
# of cycles = k + (n-1) = 5 + (8-1) = 12 cycles





5. What is the range of addressable memory in protected mode?

4GB from 00000000 to FFFFFFFFh


6. What is the range of addressable memory in real-address mode?

1MB from 00000 to FFFFFh


7. In Real -address mode. Convert the following segment-offset address to a linear address: 0950:0100

09500h+0100h=09600h




Thank you for visiting us:
Daniyal Younis