C Programming and Interfacing with Intel 80C51 Microcontroller

| 0 comments |
In this tutorial, we illustrate how to write C program that turns on and off a LED connected to the port of a Intel 80C51 microcontroller chip. Such simple project forms the basis of embedded software development with C.

Intel 80C51 is an 8 bit microcontroller used in many areas of embedded systems design. For our purpose here it should be noted that the 80C51 has 4 ports called Port0, Port1, Port2 and Port3. All of these are bidirectional port. Each of the port has 8 pins and each of them can be written to and read from. So there are 4x8=32 I/O ports.

Port 1 is different from others in that it is designed as an I/O port. Other ports additional to input/output function also provides other special functions which will not be discussed here.

Here we will look at how the individual pins of the Port 1 can be controlled. That is how to send a bit, read a bit and how to send a byte and read a byte. This is how you usually begin learning a microcontroller and C programming as well.

We will start by writing 1 bit to the port 1 pins.

Consider the following schematic:


In the above figure, a LED is connected to the Port 1, pin 0. So to turn on the LED we must have logic high at the port pin 0. The C program for doing this is as follows,

#include <reg51.h>

sbit mybit = P1^0;

void main(void)
     {
      mybit = 0;
      }

In the above code, the Port 1 bit 0 is assigned a variable called mybit is declared using the sbit data type. In the main function this variable is set to 0 meaning that port 1 bit 0 is set to logic 0 and therefore doing this will not turn on the LED.

But if we change the above code so that mybit = 1; then now the Port 1 bit 0 has logic 1 high and therefore due to the potential difference created between that pin and the ground current flows into the LED and the LED turns on.

So to turn on the LED we would write the C program as follows:

#include <reg51.h>

sbit mybit = P1^0;

void main(void)
     {
      mybit = 1;
      }

The result is shown,


Notice that the LED is turned into blue.

In the above schematics we did not limit the current through the LED. One should add a resistor to limit the current flowing into the LED so that it does not get excessive current otherwise it will burn and get damaged.

So lets add a resistor before we move on. The LED has 2.2V forward voltage and current limit of 10mA. If the Pin voltage is at 5V then we can calculate the resistor value to limit the current into the resistor to 10mA.

R = (5V-2.2V)/10mA = 380 ohm ~370ohm.

OK, see the diagram below



Above we showed you how to turn off and on a LED at the port 1 pin 0 of the microcontroller.

In next tutorial post we illustrate how to write program with delays to turn on and off the LED.

For learning what is Proteus and how it is useful for embedded system development see the blog post- Embedded Systems Programming with Proteus Software.

Read More..

Simple multiplication assembly program for 8086

| 0 comments |
In this tutorial it is shown how to write 8086 assembly program, how to use embedded software development tool to run the program and save the program in executable format. The program we will be writing is a simple two 16 bit word multiplication stored in memory. The Intel 8086 microprocessor is a 16 bit microprocessor which can still be used for embedded system design for industrial plants.

The assembly program is as follows,

data segment
        x dw 40D
        y dw 02D
        z dw 2 dup(0)
data ends
   
code segment
   
    ASSUME CS:code,DS:data

start: mov ax,data
       mov ds,ax
       mov ax,x
       mul y
       mov z,ax
       mov z+2,dx
code ends

end start

In the above code we have used the segments and ends directives to group the data and code parts of the program. The data segment in the first line and data ends groups the data in the code. They are called logical segment. Within this logical segment called data we have declared some data x, y and z. x is the multiplicand and y is the multiplier and z is the product, that is- z = x*y. We have used dw to define the variables x,y and z. x is initialized to 40D which means 40 in decimal, y is initialized to 2D which means 2 in decimal and the z dw 2 dup(0) sets aside memory for 2 words initialized to all zeros.

The code segment with code ends contains the program code. Within it the first line is the assume directive. This assume directive tells assembler that the logical segment called data contains the data and the logical segment called code contains the program code.

Next start is a label which gives an identification for an address. The mov ax,data instruction causes the accumulator register AX to store the starting addressing of the data segment in it. The next instruction mov ds,ax causes the transfer of address stored in accumulator to the DS register. This is required because the DS register is not directly reachable via instructions. Next mov ax,x causes to move the value stored(40D) in memory location x to the accumulator. Then the value stored in memory location y(2D) is multiplied with the contained in the accumulator which is 40D. The result is stored in the accumulator which is 50H(80D). The next instruction mov z,ax moves the result of multiplication from AX register to memory location specified by z. The final instruction mov z+2,dx copies the high word of the multiplication result from DX to memory. When the assembler reads this instruction, it will add the indicated 2 to the displacement it calculated for z and inserts the result as for the binary code for the instruction.

 To write an assembly language program and create executable file we need an assembler. To do this we can use emu8086 which is freely available on the internet.

The following is a screenshot which shows the program entered into this 8086 embedded software development tool.

8086 microprocessor embedded software development tool

To create the executive file(.exe) we can click on the compile button on the toolbar. Doing this the software ask where to save the .exe file. Choose some folder in your computer and hit ok. Once you have saved it you can run the program.

The software will run the program and stop the execution as shown below.

8086 microprocessor embedded software development tool

8086 microprocessor embedded software development tool

To check the program(or debug for if you had some problem) we can click on the reload button and then check the program step by step by clicking on the single step button.

The following screenshot shows one of the stepped in view which show the result of the multiplication which is 50H stored in accumulator.

8086 microprocessor embedded software development tool

Now you have the program in .exe format which you can use for your 8086 microprocessor based embedded system designs.

This tutorial showed you how to write a simple program to multiply two 16 bit words for 8086 microprocessor. It also showed you how you can use the emu8086 software as your 8086 microprocessor embedded software development tool.
Read More..

Op Amp design tutorial using IC741

| 0 comments |
Operational amplifier finds many application in electronics design. They are one of the corner stone building blocks of any electronics system. They were conceived in early 1940s but were made available in 1952 using vaccum tubes. In this op amp design tutorial, operational amplifier circuit analysis in various application setting are described with illustration using the IC741.

Operational amplifier applications includes circuit design that requires mathematical functions such as adder, subtractor, multiplier, divider, integrator and differentiators. Not only can they be used to realize mathematical function but also realize inverting, non-inverting amplifier, unity gain amplifier(buffer) and also op-amp comparator.

Inverting Operational Amplifier Circuit Analysis

The inverting operational amplifier circuit is shown below. The circuit uses IC741 op-amp. An ac signal is applied at the inverting input and the non-inverting input is grounded. A dc signal can also be applied to the inverting input instead of ac signal. The R1 and RF resistors are the input and the feedback resistors respectively.

inverting operational amplifier circuit

One can derive an equation that relates the input and output voltages using two KVL equations. The input and the output voltage relation is,

vout = - vin*(Rf/R1)

 To derive the input and output voltage relation for the inverting operational amplifier it is helpful to remember two things- Consider that the op-amp is ideal then in absence of any input source there is no current flowing either into the two input terminals and that there is no voltage difference between the two input terminals.

Then after ac source(or dc source) is applied to the inverting terminal of the op-amp, the current i flows into R1 then goes into Rf and appears at the output. In this case we can apply KVL as follows,
[v_{in}=iR_1+iR_f+v_{out}]
or,
[v_{out}=v_{in}-i(R_1+R_f)]
Then we derive another KVL equation using the fact that since there is no voltage difference between the two terminal then the voltage at the point X as shown in the figure below is also at Zero volt because the non-inverting terminal is at Zero volt.

inverting operational amplifier circuit

The point X is also called virtual ground. The KVL equation considering this gives us-
[v_{in}=iR_1]
Substituting i from this equation into the above equation we get the relation between the input an output voltage for the inverting amplifier as follows,
[v_{out}=-v_{in}(frac{R_{f}}{R_{1}})]
 The ratio Rf/R1 is called the gain or attenuation of the inverting op-amp. If Rf is greater than R1 then we have an amplifier and if Rf is less than R1 then we have an attenuator. The negative sign in the equation shows that the output voltage signal is out of phase with the input voltage signal.

The following graph shows the input and the output voltages waveforms;


The input voltage is 1V ac signal and the output voltage is amplified 2V ac signal. Notice that they are out of phase by 180 degree which is due to the negative sign in the output voltage equation above.

Non-Inverting Operational Amplifier Circuit Analysis

Next consider the circuit design of a non-inverting op-amp. In this case the input is applied to the non-inverting input terminal of the op-amp. The inverting terminal is grounded via a resistor(R1). The feedback from the output terminal is taken to the input terminal at the inverting terminal. This circuit is shown below,


In this case the output voltage is,
[v_{out}=v_{in}(1+frac{R_{f}}{R_{1}})][v_{out}=v_{in}(1+frac{R_{f}}{R_{1}})]
The absence of the negative sign indicates that the output voltage is in phase with the input voltage.

The following graph shows the output voltage and the input voltage waveform.


The above waveform graph illustrates that the input and output voltages are in phase and that the output voltage is amplified.

Adder Operational Amplifier Circuit Analysis

Op-amps can be used for doing mathematical operation. One is the addition of analog continuous signal. The adder operational amplifier circuit is shown below.



In the adder circuit above, the input V1, V2 and V3 have amplitude of 1V, 2V and 3V respectively and all had the same frequency of 10Hz. These input were connected together and applied at the inverting input of the IC741. The resistor values are the same so that the output voltage is the sum of the 3 inputs, that is the output signal has 6V(1V+2V+3V). Had we taken different value of Rf(i.e the feedback resistor) but same input resistor values then we would have amplified the signal and not 6V. In the circuit above we took 10K ohm resistor but we could have equally taken 1K ohm resistor for all of those resistors or any other value of resistance.

The output voltage in terms of input voltage and resistor values is,
 [v_{out}=-(v_{1}+v_{2}+v_{3})(frac{R_{f}}{R})]
 Now the following shows the waveform of various inputs and output.

The 3 input voltages with frequency of 10Hz.


The following shows the Vin at the input terminal of the op-amp.


Then the following is the output voltage waveform which has 6V amplitude,



Difference/Differential Operational Amplifier Circuit Analysis

 Another application of the op-amp is realizing a subtractor or a difference or differential amplifier. Here two signal which are to be subtracted are applied at the non-inverting and inverting terminals of the op-amp. The op-amp outputs the difference signal given that the input resistors at the input terminals and the feedback resistor are the same.

The differential operational amplifier circuit is shown below,


 In the above differential op amp circuit design, the input V1 has amplitude of 1V and the input V2 has amplitude of 3V and both have frequency of 10Hz. The output should be an ac signal with amplitude 2V(3V-1V).

The equation relating the output and inputs signal for the difference amplifier is,
[v_{out}=v_{2}-v_{1}]



Voltage Follower/ Unity Gain Amplifier/ Buffer Operational Amplifier Circuit Analysis

 Another application of operational amplifier is buffering signal. Why this is essentially useful is that it signal which are distorted can be smoothed using buffer and also the input signal can be delayed or saved or buffered for certain time. Such circuit is also called voltage follower because the output signal is the same as the input signal, that is same in respect to magnitude and phase. The circuit is also called unity gain amplifier because the output signal is not amplified, in other words, the magnitude of the output signal is not increased.

The following figure shows the voltage follower operational amplifier circuit,


 The mathematical relation between the output and input signal is very simple:
Vout=Vin

The following waveform graph shows the output and input signal waveform which are overlapping.

Read More..

VHDL Programming tutorial on Priority encoder

| 0 comments |
Priority Encoder is an important class of Encoder. It is different from a ordinary encoder in that it gives priority to the input signal. The signal corresponding to the higher priority is outputted by the Priority encoder.

Here the design of 8 to 3 priority encoder is taken as an example for VHDL programming tutorial.

The truth table of a 8 to 3priority encoder is shown below:

8 to 3 priority encoder

In the truth table, the input data is x7x6x5x4x3x2x1x0 which is 8 bit input. And the 3 bit output is y2y1y0. The z signal indicates a condition that all input bits are 0 which is also a possible combination.

The priority is the signal with input 1XXXXXXX where X indicates dont care which means it does not matter whether it is 0 or 1. The next priority goes to 01XXXXXX and so on up on the table.

Suppose if 10100110 is the input data then the output is 111.

Below is the VHDL code for this 8 to 3 priority encoder:

library ieee;
use ieee.std_logic_1164.all;

entity prio_encoder is
    port(
    x : in std_logic_vector(7 downto 0);
    y : out std_logic_vector(2 downto 0);
    z : out std_logic
    );
end prio_encoder;

architecture model of prio_encoder is
begin
   
    process(x)
    begin
        if (x(7) = 1) then y <= "111";
        elsif (x(6) = 1) then y <= "110";
        elsif (x(5) = 1) then y <= "101";
        elsif (x(4) = 1) then y <= "100";
        elsif (x(3) = 1) then y <= "011";
        elsif (x(2) = 1) then y <= "010";
        elsif (x(1) = 1) then y <= "001";
        else y <= "000";
        end if;
       
        end process;
       
        z <= 0 when x = "00000000" else 1;           

end model;

In the above code, we used if elsif then statement of VHDL to implement the priority encoder. Since the if statement is a sequential state it is written inside the Process statement with sensitivity signal as x. The first statement is checked first and then next statement inside a process since the statements are sequential. If the first statement is true then the output is send to the output and the process exits. If not then the second statement is checked and if it evaluates true then it corresponding output is outputted and so on. So this code implements priority.The last else statement is needed so that the synthesizer does not create a latch. That is all combination of the input must be included. Finally the z output when all inputs are 0s is implemented outside the process statement.

The simulated waveform is shown below:

8 to 3 priority encoder simulated waveform

Encoders are important part of a digital system. There are other application of encoders such as code conversion encoders and includes designs that needs to be encoded to reduce output signals.
Read More..

VHDL tutorial on Shift Register Design using D Flip Flop as component

| 0 comments |

This VHDL tutorial shows how D flip flop symbols can be used to implement a block diagram of a shift register and stimulate the design. The shift register has 4 flip flops. So first we need a D flip flop vhdl design then we can use it as component for the top level block diagram.

The VHDL code for the D flip flop is as follows,

library ieee;
use ieee.std_logic_1164.all;

entity DFF is
    port(
    clk: in STD_LOGIC;
    rst: in STD_LOGIC;
    D: in STD_LOGIC;
    Q: out STD_LOGIC
    );
    end DFF;

    architecture DFF_arch of DFF is
    begin
process (CLK)
begin
    if CLKevent and CLK=1 then 
        if rst=1 then   
            Q <= 0;
        else
            Q <= D;
        end if;
    end if;
end process;
    end DFF_arch;

Next we use create the shift register as a block diagram and place the D flip flop symbol that was created earlier into the block diagram. First we need create a new block diagram in the VHDL Software then we need to add its port which are Din, clk and rst as std_logic inputs and Dout which is the std_logic output.

After defining the block diagram we insert four D flip flip into the block diagram and connect them as shown in the following figure.

Shift register with D flip flop


The VHDL code for the same block diagram is as follows,

library IEEE;
use IEEE.std_logic_1164.all;

entity shift_reg_block is
  port(
       Din : in STD_LOGIC;
       clk : in STD_LOGIC;
       rst : in STD_LOGIC;
       Dout : out STD_LOGIC
  );
end shift_reg_block;

architecture shift_reg_block of shift_reg_block is

component DFF
  port (
       D : in STD_LOGIC;
       clk : in STD_LOGIC;
       rst : in STD_LOGIC;
       Q : out STD_LOGIC
  );
end component;


signal Q1, Q2, Q3 : STD_LOGIC;

begin

DFF1 : DFF
  port map(
       D => Din,
       Q => Q1,
       clk => clk,
       rst => rst
  );

DFF2 : DFF
  port map(
       D => Q1,
       Q => Q2,
       clk => clk,
       rst => rst
  );

DFF3 : DFF
  port map(
       D => Q2,
       Q => Q3,
       clk => clk,
       rst => rst
  );

DFF4 : DFF
  port map(
       D => Q3,
       Q => Dout,
       clk => clk,
       rst => rst
  );

end shift_reg_block;

Now in order to stimulate this design we need to create a testbench. Following is the testbench for this shift register.

library ieee;
use ieee.std_logic_1164.all;

entity shift_reg_block_tb is
end shift_reg_block_tb;

architecture TB_ARCHITECTURE of shift_reg_block_tb is

    component shift_reg_block
    port(
        Din : in STD_LOGIC;
        clk : in STD_LOGIC;
        rst : in STD_LOGIC;
        Dout : out STD_LOGIC );
    end component;

    signal Din : STD_LOGIC;
    signal clk : STD_LOGIC;
    signal rst : STD_LOGIC;

    signal Dout : STD_LOGIC;

begin

    UUT : shift_reg_block
        port map (
            Din => Din,
            clk => clk,
            rst => rst,
            Dout => Dout
        );

    clk_pro : process
    begin
        clk <= 0;
        wait for 5 ns;
       
        clk <= 1;
        wait for 5 ns;
       
    end process;
  
    sti_pro : process
    begin
        Din <= 0;
        wait for 10 ns;
       
        Din <= 1;
        wait for 10 ns;
       
        Din <= 1;
        wait for 10 ns;
       
        Din <= 0;
        wait for 10 ns;
       
        Din <= 0;
        wait for 10 ns;
       
        Din <= 1;
        wait for 10 ns;
       
        Din <= 1;  
        wait for 10 ns;
       
        Din <= 0;
        wait for 10 ns;

       
    end process;

end TB_ARCHITECTURE;

configuration TESTBENCH_FOR_shift_reg_block of shift_reg_block_tb is
    for TB_ARCHITECTURE
        for UUT : shift_reg_block
            use entity work.shift_reg_block(shift_reg_block);
        end for;
    end for;
end TESTBENCH_FOR_shift_reg_block;

The simulation waveform is shown below,

simulation of shift register



Read More..

download C programming for Microcontrollers by Joe Pardue free

| 0 comments |
Download here C Programming for Microcontrollers Featuring ATMELs AVR Butterfly and the free WinAVR Compiler by Joe Pardue for free. This is a good book on learning how to program AVR microcontroller using C program recommended by many. The book teaches basics of programming AVR, connecting the microcontroller to the PC for programming, using free Compilers, downloading the program into the microcontrollers. Then it teaches how to create program for AVR microcontroller to control input/ output ports with example of making LEDs connected to the port turn on and off. It also teaches how to program AVR microcontroller to communicate with PC using serial communication via the USART interface. Other C programming tutorials includes programming AVR in C for the analog to digital conversion, digital to analog conversion, LCD display control and others.

C Programming for Microcontrollers Featuring ATMELs AVR Butterfly and the free WinAVR Compiler by Joe Pardue
 Download Link for C programming for Microcontrollers pdf ebook by Joe Pardue

http://www.filefactory.com/file/si1nbwgcphn/JoeC.pdf


The Book not only provides tutorials and information on C programming and ATMEL microcontrollers but also teaches soldering, making physical connections etc required in the designs. Good example illustration of using AVR microcontroller for controlling mechanical machines such as motors with pictures are provided so that reader can understand what is being done. See one such picture screenshot from the book-




Read More..

Decoder implementation using the Shift operators in VHDL

| 0 comments |
One of the different method of implementing a decoder in VHDL is to use the shift operators of vhdl language. Using these operator can shorten the code and can be extended easily to higher number of input/output bits. Here it is shown how a 3x8 decoder can be implemented using vhdl shift operator and verified and simulated using the active-hdl VHDL software.

Before going to the implementation readers may want to read other ways of implementing decoder. For this follow the following links-
  • 74LS138 Decoder design using logical gates
  • 74LS138 Decoder design using With Select statement 
  • 74LS138 3x8 decoder design with case construct in vhdl
  • 74LS138 3x8 decoder design using if else construct
In this vhdl tutorial we gonna see how the shift operator in VHDL can be used to implement a decoder. The idea of using shift operator comes from the fact that there is bit shift in the output of the decoder according the input. If we let x be 4 bit input and y be the 8 bit output then one can observe the output y being in the form- 10000000, 01000000, 00100000, 00010000 ...00000001, which shows that 1 is shifted to the right one bit according to the input x. Now x is 4 bit binary but when it is converted to integer then x as integer indicates the number of shift required.

The following VHDL code illustrates how a decoder could be realized using shift operator in vhdl:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity decoder_shift is
    generic (n : positive := 4);
    port(
    x : in std_logic_vector(n-1 downto 0);
    y : out std_logic_vector(2**n-1 downto 0)
    );
end decoder_shift;

architecture decoder_shift_arch of decoder_shift is
constant yout : bit_vector(2**n-1 downto 0) := (0=>1,others => 0);
begin
    y <= to_stdlogicvector(yout sll to_integer(unsigned(x)));
   
end decoder_shift_arch;


In the above as x input is a std_logic_vector it is first unsigned and then to integer. The shifting operater ssl is used to shift the intermediate signal yout. Since shifting operator ssl acts only on bit_vector, intermediate signal yout is defined as bit_vector. After the shifting the bit_vector is converted back to std_logic_vector using the function to_stdlogic_vector and assigned to the original output y.

The advantage of using shift operator for modelling the decoder is that it requires less code lines to implement the decoder. Another advantage is that it can be easily adopted to higher number of input/output bits by changing the generic bit number n declaration.

The code was simulated with active-hdl vhdl software and the waveform of the simulation is shown below.

decoder simulation in vhdl software

Read More..

Sejarah Visual Basic

| 0 comments |
Bahasa pemrograman yang paling awal dirancang pada tahun 1950-an dan dibuat semata-mata untuk memecahkan masalah matematika yang kompleks. Bahasa-bahasa tersebut agak membingungkan bagi orang awam. Namun hal itu bukanlah masalah berbesar, karena komputer hanya ditemukan di lembaga-lembaga riset besar. Lambat laut tentunya orang sadar bahwa teknologi komputer bisa berguna tidak hanya untuk melakukan perhitungan matematika, namun bisa berguna untuk bidang yang lain. Maka komputer pun mulai menjadi barang yang biasa ditemukan di lingkungan bisnis dan universitas. Dengan semakin banyaknya orang yang menggunakan komputer, semakin banyak pula orang yang sadar bahwa bahasa pemrograman yang rumit hanya akan menghambat perkembangan komputer itu sendiri. Pada tanggal 1 Mei 1964, penemu bahasa BASIC, yaitu Profesor John G. Kemeny dan Thomas E. Kurtz di Dartmouth College di New Hampshire menjalankan pertama kali program BASIC.

Bahasa BASIC (Beginner’s All-purpose Symbolic Instruction Code) merupakan bahasa tingkat tinggi yang berbentuk interpreter, yang memungkinkan untuk mengoperasikan komputer secara interaktif, program dapat ditulis, dijalankan, diubah dan dijalankan lagi tanpa harus melalui tahap kompilasi seperti pada bahasa tingkat tinggi lainnya yang berbentu compiler. Bahasa ini dirancang khusus untuk memudahkan tugas belajar memprogram.

Pada tahun 1975, Paul Allen, pemrogram muda yang bekerja ada perusahaan komputer Honeywall dengan teman masa kecilnya William Bill Gates menawarkan interpreter BASIC kepada Ed Robert, pemilik perusahaan MITS yang memproduksi komputer mikro Altair 8800 yang mempunyai RAM 4 KB. Kedua orang ini semasa di SMA sudah pernah mendirikan perusahaan dengan nama Traf-O-Data, tetapi tidak sukses. Ed Robert berjanji akan membeli interpreter BASIC tersebut apabila ia bisa berjalan di atas komputer Altair. Paul Allen dan Bill Gates mengembangkan interpreter BASIC tersebut tanpa pernah melihat secara langsung bentuk dari komputer Altair, apalagi menggunakannya. Apa yang mereka andalkan adalah manual dari microprocessorIntel 8080 yang digunakan di Altair dan diagram dari komputer Altair itu sendiri. Untuk mengujinya, mereka menjalankan interpreter BASIC-nya pada komputer besar dan akhirnya merekam hasilnya ke pita kertas (paper tape). Ketika Paul Allen akan mendemonstrasikan hasil kerjanya pada Ed Robert, dia teringat bahwa belum ditulis suatu program loader untuk membaca dan meletakkan interpreter BASIC yang ada di paper tape ke dalam main memory Altair. Paul Allen langsung menulis program loader tersebut dalam bahasa mesin dan memanggil interpreter BASIC dari pita kertas. Setelah beberapa menit, program berhasil masuk ke main memory. Paul Allen menyadari bahwa dia dan Bill Gates telah membuat banyak kesalahan di sana-sini, walaupun demikian, interpreter BASIC ini akhirnya dapat berjalan juga di komputer mikro Altair dan Ed Robert jadi membelinya. Untuk kedua kalinya, Paul Allen dan Bill Gates mendirikan suatu perusahaan yang disebut dengan Microsoft, yang terkenal sampai sekarang. Inilah cikal bakal dari BASIC yang terkenal itu.

Beberapa tahun kemudian muncullah bahasa pemrograman tingkat tinggi yang dengan menawarkan berbagai macam fungsi dalam pustakanya (library). Akan tetapi, untuk membuat sebuah aplikasi bisnis berbentuk grafik masih merupakan pekerjaaan yang cukup sulit untuk dilakukan. Jangankan aplikasi berbentuk grafik untuk menangani permasalahan mencetak data ke dalam printer saja sudah cukup untuk membuat pemrogram kesulitan. Belum lagi untuk membedakan antara printer satu dengan yang lainnya, walaupun keduanya mempunyai tipe yang sama, yaktu sama-sama dotmatrix, pemrogram harus terlebih dahulu membuat sebuah program yang mengakomodasi semua printer tersebut. Itulah gambaran kesulitan yang dialami oleh generasi pertama pemrogram. Dibutuhkan lebih dari 20 tahun untuk mendapatkan lingkungan pemrograman berbasis DOS yang cukup stabil.

Ketika komputer mikro tergusur oleh IBM PC, maka inilah zaman dimulainya era komputer pribadi (personal computer – PC) dengan antarmuka pemakai grafis (Graphical User Interface – GUI). Dengan munculnya Microsoft Windows, para pemakai PC bisa bekerja dalam lingkungan yang kaya grafis dan intuitif. Dengan GUI menyebabkan aplikasi-aplikasi jauh lebih mudah dipelajari dan dipakai. Hal ini sebagai ganti belajar mengetikkan dan menghafal perintah-perintah yang panjang, para pemakai cukup memilih sebuah menu dengan mengklik tombol mouse. Jendela-jendela pada layar memungkinkan pemakai untuk menjalankan lebih dari satu program secara bersamaan (multi-tasking). Kotak-kotak dialog muncul ketika sebuah program membutuhkan konfirmasi dari pemakai.

Pada tahun 1986, Dr. Bjarne Stroustrup meluncurkan bukunya yang sangat berpengaruh dengan judul The C++ Programming Language sebagai tanda dimulainya era pemrograman berorientasi objek (Object Programming Language -OOP). Pada tahun yang sama Intel meluncurkan microprocessor 32 bit yang pertama kali yakni 386. Banyak pemrogram profesional Amerika menggunakan bahasa C++ sebagai bahasa pemrogramannya ketika membangun suatu aplikasi yang berjalan di atas Windows. Pustaka-pustaka class (class library) dibangun untuk membantu kecepatan pengembangan suatu aplikasi. Terutama class yang berhubungan dengan objek.

Banyak orang percaya bahwa Windows mengawali masa berakhirnya pemrogram amatir. Dalam dunia MS-DOS, para profesional dalam di bidang non-komputer, biasanya mampu menulis aplikasi-aplikasi sederhana yang membantu mereka dalam pekerjaannya, merampingkan perhitungan yang membosankan, atau mengelola data dengan cepat. Jadi C++ bukanlah bahasa yang tepat untuk mereka. Karena yang mereka butuhkan adalah bahasa pemrograman yang cepat dan mudah dipelajari. Sementara C++ adalah bahasa yang benar-benar berbeda dengan bahasa C sebelumnya karena mengandung OOP. Pada waktu itu, sebagian besar pemrogram profesional membutuhkan waktu 6 bulan untuk akrab dengan konsep OOP seperti pengkapsulan (encapsulation), pewarisan (inheritance), dan polimorfisme (polymorphism). Namun bisakah setiap orang memahami hal-hal tersebut? Tentu tidak, apalagi tuntutan pemrograman dalam Windows begitu rumit bahkan untuk aplikasi yang paling sederhana sekalipun.

Tuntutan ini terjawab pada 1991, ketika Microsoft memperkenalkan Visual Basic versi 1.0. Sistem pemrograman Visual Basic mengemas kerumitan Windows dengan cara yang benar-benar menakjubkan. Sejumlah besar pemrogram yang kesulitan untuk mempelajari C++ atau pemrogram yang membutuhkan bahasa pemrograman yang lebih mudah dan lebih produktif untuk lingkungan Windows 3.0, dapat dengan mudah dan sukses pindah ke Visual Basic.

Dengan mengkombinasikan kemampuan bahasa Basic dan peranti desain visual, bahasa ini menyediakan kesederhanaan dan kemudahan pakai tanpa mengorbankan kinerja atau fasilitas grafis yang menyebabkan Windows menjadi lingkungan kerja yang begitu menyenangkan. Menu, tombol, textbox, font, dan semua elemen lainnya dengan mudah dapat dirancang. Dan semua fasilitas tersebut tidak membutuhkan lebih dari beberapa baris pemrograman.


Berikut Perjalanan Visual Basic (VB 1.0 Sampai VB 10)
• VB 1.0

Visual Basic 1.0 adalah salah satu bahasa komputer pertama yang mendukung pemrograman event-driven. Event-driven adalah gaya pemrograman yang sangat cocok untuk antarmuka pemakai grafis. Secara tradisional, pemrograman adalah sesuatu yang berorientasi pada proses dan langkah demi langkah. Sebagai ganti menuliskan sebuah program yang mengeplot setiap langkah dalam urutan tepat, pemrogram menuliskan sebuah program yang bereaksi terhadap tindakan pemakai seperti memilih sebuah menu, mengklik jendela, atau menggerak mouse. Suatu program yang besar dapat diganti dengan kumpulan miniprogram yang dipicu oleh event-event yang dilakukan oleh pemakai. Dan dengan Visual Basic, aplikasi seperti ini bisa dituliskan dengan cepat dan mudah. Sebagaimana kata Visual yang tersirat, pemrograman dilakukan secara visual. Ini berarti bahwa sebuah aplikasi sudah terlihat hasilnya walaupun belum dijalankan. Letak dan ukuran menu, textbox, tombol, dan elemen lainnya dapat dirancang dengan menggunakan mouse dan keyboard.

• VB 2.0
Visual Basic 2.0 dirilis pada November 1992, Cakupan pemrogramannya cukup mudah untuk digunakan dan kecepatannya juga telah di modifikasi. Khususnya pada Form yg menjadikan object dapat dibuat secara seketika, serta konsep dasar dari Class modul yg berikutnya di implementasikan pada VB 4

• VB3.0
Untuk memenuhi untuk tuntutan dari para pemrogram seiring dengan perkembangan bisnis perusahaan, beberapa tahun kemudian Visual Basic 3.0 diluncurkan dengan kinerja yang sudah ditingkatkan. Visual Basic 3.0 , dirilis pada musim panas 1993 dan dibagi menjadi versistandard dan professional. VB 3 memasukan Versi 1.1 dari Microsoft Jet Database Engine yg dapat membaca serta menulis database Jet (atau Access) 1.x Bukan hanya DAO (Data Access Object – yang berfungsi untuk mengakses database) sudah ditambahkan, tapi juga akses data visual dengan kontrol data (data control) juga sudah diberikan. Aplikasi data-browsing dapat dengan mudah dilakukan tanpa menulis kode. Kontrol OLE (Object Linking and Embedding) juga sudah ditambahkan. Visual Basic 3.0 , dirilis pada musim panas 1993 dan dibagi menjadi versistandard dan professional. VB 3 memasukan Versi 1.1 dari Microsoft Jet Database Engine yg dapat membaca serta menulis database Jet (atau Access) 1.x

VB4.0
Seiring dengan perkembangan teknologi microprocessor yang telah berbasis 386 ke teknologi Pentium, Microsoft pun kemudian meluncurkan Windows 32 bit-nya yang pertama kali yakni Windows 95. Windows 95 sangat terkenal karena menampilkan GUI dengan konsep baru yang lebih memudahkan pemakai dalam menjalankan aplikasi. Untuk menjembatani perubahan dari Windows 3.11 (16 bit) ke dalam Windows 95, Microsoft meluncurkan Visual Basic 4.0 (Agustus 1995) yang menawarkan 2 compiler yang terpisah dan berbeda, yang satu untuk pengembangan windows 16 bit dan yang lain untuk windows 32 bit. Pada versi ini, pemrogram sudah dapat membangun program dengan berbasiskan Componen Object Model (COM) yang mendukung kemampuan untuk membuat Dynamic-Link Libraries (DLLs). Inilah untuk kali pertama konsep OOP diterapkan dalam Visual Basic.

• VB5.0
Visual Basic 5.0 (February 1997), Microsoft merilis secara eksklusif Visual basic untuk versi windows 32 bit. Programmer yg menulis programnya pada versi 16 bit dapat dengan mudah melakukan import porgramnya dari VB4 ke VB5. dan juga sebaliknya, program VB5 dapat diimport menjadi VB4. VB 5 memperkenalakan kemampuan untuk membuat User Control. Kemampuan untuk membangun dan mendistribusikan ActiveX Control diberikan pada Visual Basic 5.0. Dengan ditemukannya teknologi ActiveX, baik berbentuk Active DLL (COM) ataupun ActiveX Control (OCX).

• VB6.0
pada 1998, Microsoft meluncurkan Visual Basic 6.0 dengan 3 fitur projek baru: Data Project, DHTML Application, IIS Application. Dengan 3 senjata baru ini, diharapkan pemrograman Visual Basic sudah mampu untuk membuat aplikasi internet yang handal.

• VB7.0
Visual Basic .NET (VB 7), dirilis pada tahun 2002, Beberapa yang mencoba pada versi pertama .NET ini mengemukakan bahwa bahasa ini sangat powerful tapi bahasa yg digunakan sangat berbeda dengan bahasa sebelumnya, dengan kekurangan diberbagai area, termasuk runtime-nya yang 10 kali lebih besar dari paket runtime VB6 serta peningkatan penggunan memory.


• VB8.0

Visual Basic 2005 (VB 8.0) , merupakan iterasi selanjutnya dari Visual Basic .NET. dan Microsoft memutuskan untuk menghilangkan kata kata .NET pada judulnya. Pada Rilis ini , Microsoft memasukan beberapa fitur baru, diantaranya: 
  1. Edit and Continue , mungkin inilah kekurangan fitur terbesar dari VB .NET . pada VB 2005 ini kita diperbolehkan melakukan perubahan kode pada saat program sedang dijalankan 
  2. Perbaikan pada Konversi dari VB ke VB NET12Visual Basic .NET 2003 (VB 7.1) , dirilis dengan menggunakan NET framework versi 1.1. 


• Visual Basic 2005 Express

Visual Basic 2005 Express , merupkan bagian dari Product Visual Studio. Microsoft membuat Visual Studio 2005 Express edition untuk pemula dan yg gemar dengan VB, salah satu produknya adalah Visual Basic 2005 Express yg merupakan produk gratis dari Microsoft


• VB9.0

Basic “Orcas” (VB 9.0) , dijadwalkan akan dirilis pada tahun 2007 dan dibangun diatas .NET 3.5. Pada rilis ini , Microsoft menambahkan beberapa fitur , diantaranya : 
  1. True Tenary operator , yaitu fungsi If(boolean,value, value) yg digunakan untuk menggantikan fungsi IIF 
  2. LINQ Support 
  3. Ekspresi Lambda 
  4. XML Literals 
  5. Nullable types 
  6. Type Inference 


• VB10.0

Visual Basic ‘VBx’ (VB 10.0) , Visual Basic 10, yang juga dkenal dengan nama VBx, akan menawarkan dukungan untuk Dynamic Language Runtime. VB 10 direncanakan akan menjadi bagian dari SilverLight 1.1

Beberapa Fungsi Komponen-Komponen VB : 
  1. Text Box : Text box merupakan kontrol yang dipakai sebagai tempat untuk mengisi maupun menampilkan data. Contohnya pada aplikasi penjualan ini yaitu text box diisi dengan nama-nama stock barang yang akan disimpan ke dalam database.
  2. Label : Label merupakan kontrol yang dipakai sebagai tempat untuk menampilkan keterangan. 
  3. Command Botton : Command button merupakan kontrolyang dipakai sebagai tombol untuk melakukan sebuah proses. 
  4. Combo Box: Combo box merupakan kontrol yang dipakai sebagai tempat untuk menampilkan daftar pilihan. Dengan combo box kita tinggal memilih pilihan yang ada pada combo box tersebut. 
  5. List Box : List Box memiliki fungsi yang hamper sama dengan combo box, yaitu menampilkan daftar. Perbedaannya, pada combo box hanya satu pilihan yang terlihat sebelum combo box diklik, sedangkan pada list box dapat menampilkan beberapa pilihan. 
  6. Option Botton : Option button berfungsi untuk menampilkan daftar pilihan. 
  7. Frame: Frame berfungsi untuk mengelompokan kontrol-kontrol pada form menjadi satu bagian. 
  8. List Box : Digunakan Untuk Menampilkan Daftar Pilihan Yang Bisa Digulung. 
  9. Hscroll bar : Untuk Penggulungan Dengan Langkah Lebar Dengan Indikasi Posisi Pemilihan Dlm Posisi Horizontal. 
  10. Vscroll bar: Untuk Penggulungan Dengan Langkah Lebar Mengindikasikan Posisi Pemilihannya Vertical. 
  11. Timer : Untuk Penghitung Waktu Event Dalam Interval Yang Ditentukan. 
  12. Drive list box : Untuk Menampilkan Disk Drive Yang Di Miliki Komputer. 
  13. Dir list box : Menampilkan Direktori Dan Path. 
  14. File list box : Menampilkan Sebuah Daftar File. 
  15. Shape : Untuk Memasang Kontrol Yang Mampu Menghasilkan Sarana Agar Peamakia Bisa Menggambar Berbagai Bentuk. 


Sumber : wikipedia
Read More..

Design of Analog CMOS Integrated Circuits Download Ebook Free

| 0 comments |
Download Design of Analog CMOS Integrated Circuits ebook free written by Behzad Razavi. This book is used as a textbook at the University of California to teach graduate students the analysis and design of Integrated Circuit using CMOS technology. This book is not meant for RF circuit design using CMOS like the The Design of CMOS Radio Frequency Integrated Circuits book by Thomas Lee. This book focuses on the single stage amplifiers, differential amplifers, feedback networks, operational amplifers, frequency response, stability, frequency compensation for IC design. It does however contain the an introduction to analog design, the physics of MOS, CMOS processing steps and layout and packaging chapter. For RF design besides the above mentioned contents of amplifiers the other useful content are the analysis of oscillators and phase locked loop.


Download link for Analog CMOS Integrated Circuits:

http://www.filefactory.com/file/6qb7t9c1fa3r/Behzad_Razavi_Design_of_Analog_CMOS_Integrated_Circuits__2003.pdf

This book provides excellent analysis of different types and configuration of CMOS amplifiers, frequency response, non-linearities, noise bandwidth, stability, feedback network configuration etc.
Read More..

Download Solidworks 2014 Software free

| 0 comments |
Download Solidworks 2014 software free from the links below. Solidworks is a 3D CAD software widely used for prototyping and simulating engineering designs. It helps engineers in visualization of end products and create innovative products before manufacturing. The designed product files can be exported to other engineering design software or design files from other CAD software can be imported to Solidworks and make appropriate changes to the design. Various materials can be used for the design of various parts and then various simulation- thermal, stress, vibrational, fluid flow etc simulation can be performed to visualize the performance of the designed product. Drawing tools of Solidworks makes it easy to model complex designs and create truly unique product designs.


Download links of Solidworks 2014 for 32 bit OS:

https://safelinking.net/p/86a5e71f9d 
 or,
https://safelinking.net/p/6b73f1053a  
or,
https://safelinking.net/p/65421cc440
https://safelinking.net/p/4693c9d9b5
https://safelinking.net/p/5dd2b46b8e
https://safelinking.net/p/9acec14ac7
https://safelinking.net/p/c077167cab
https://safelinking.net/p/d19633fb28
https://safelinking.net/p/fed852c3aa
https://safelinking.net/p/588257ac80
 


Download link of Solidworks 2014 for 64 bit OS:

https://safelinking.net/p/1fa4572987 
or,
https://safelinking.net/p/bdd2f8c8dd 
or,
https://safelinking.net/p/4d1fb418e4
https://safelinking.net/p/c76cab1461
https://safelinking.net/p/0be0c9eec3
https://safelinking.net/p/0d4a1d87f0
https://safelinking.net/p/fbaae3966a
https://safelinking.net/p/cc5e514a4c
https://safelinking.net/p/251f2792c8
https://safelinking.net/p/67315c6f1b
https://safelinking.net/p/be41f9752b


 For electronics product designers the design can be quickly prototyped onto Printed Circuit board(PCB) and electronics components can be created easily with Solidworks from the component datasheets from manufacturers. Once the design architecture is satisfactory it can be sent for customer review.
Read More..

Code Converter VHDL

| 0 comments |
In digital system, many types of code exist that are used for different application. Binary Codes, Excess-3 codes and Gray codes are 3 different codes that are used in digital system. Binary codes are also called BCD(Binary Coded Decimal) and are 4 bit codes that represents 16 different decimal values. Excess-3 codes are codes obtained by adding 3 equivalent binary codes to each of the BCD binary codes starting from 0(0000). Gray codes are another type of codes which have the property that there is only one bit change in going from one code to the next.

 The following table shows the BCD, Excess-3 and the Gray codes and their relation:



A code converter is often required to convert from one code to another.

In VHDL programming we can use the concurrent statement select to convert the binary to excess-3 as follows:

library ieee;
use ieee.std_logic_1164.all;

entity bi2ex3 is
    port(x : in std_logic_vector(3 downto 0);
    y : out std_logic_vector(3 downto 0)
    );
end bi2ex3;

architecture model of bi2ex3 is
begin
    with x select
    y <= "0011" when "0000",  
    "0100" when "0001", 
    "0101" when "0010",  
    "0110" when "0011",   
    "0111" when "0100",   
    "1000" when "0101",   
    "1001" when "0110",       
    "1010" when "0111",       
    "1011" when "1000",       
    "1100" when "1001",
    "1101" when "1010",
    "1110" when "1011",
    "1111" when "1100",
    "0000" when "1101",
    "0001" when "1110",
    "0010" when others;
   
end model;

The simulated waveform obtained from a VHDL software is as follows:


Similarly we can use case statement of VHDL to construct the above code conversion truth table.
Read More..

Different ways of implementing D Flip Flip with VHDL

| 0 comments |
Shown below is a table that shows how D flip flop can be implemented in different ways with VHDL. The first row shows the same D flip flop different inputs, that is, with asynchronous and synchronous reset. The second row shows different way of writing the behavior of the D flip flop.




DFF without asynchronous reset
DFF with asynchronous reset
DFF with synchronous enable
DFF with synchronous enable
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d : in std_logic;
q : out std_logic;
clk : in std_logic
);
end dff;
architecture dff_arch of dff is
begin
process(clk)
begin
if(clkevent and clk = 1)then
q <= d;
end if;
end process;
end dff_arch;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d : in std_logic;
q : out std_logic;
rst : in std_logic;
clk : in std_logic
);
end dff;
architecture dff_arch of dff is
begin
process(clk, rst)
begin
if(rst = 1)then
q <= 0;
elsif(clkevent and clk = 1)then
q <= d;
end if;
end process;
end dff_arch;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d : in std_logic;
en : in std_logic;
rst : in std_logic;
clk : in std_logic;
q : out std_logic
);
end dff;
architecture dff_arch of dff is
begin
process(clk, rst)
begin
if(rst = 1)then
q <= 0;
elsif(clkevent and clk = 1)then
if(en = 1) then
q <= d;
end if;
end if;
end process;
end dff_arch;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d : in std_logic;
en : in std_logic;
rst : in std_logic;
clk : in std_logic;
q : out std_logic
);
end dff;
architecture dff_arch of dff is
signal int_reg, int_next : std_logic;
begin
process(clk, rst)
begin
if(rst = 1)then
int_reg <= 0;
elsif(clkevent and clk = 1)then
int_reg <= int_next;
end if;
end process;
int_next <= d when en = 1 else int_reg;
q <= int_reg;
end dff_arch;
Implicit function call example
Explicit function call example
No function call, simple edge detect
Using if statement and function call
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d, clk : in std_logic;
q : out std_logic
);
end dff;
architecture dff_behave of dff is
begin
process
begin
wait until rising_edge(clk);
q <= d;
end process;
end dff_behave;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d, clk : in std_logic;
q : out std_logic
);
end dff;
architecture dff_behave of dff is
begin
process
begin
wait on clk until rising_edge(clk);
q <= d;
end process;
end dff_behave;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d, clk : in std_logic;
q : out std_logic
);
end dff;
architecture dff_behave of dff is
begin
process
begin
wait until clkevent and clk = 1;
q <= d;
end process;
end dff_behave;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port(
d, clk : in std_logic;
q : out std_logic
);
end dff;
architecture dff_behave of dff is
begin
process
begin
wait on clk;
if rising_edge(clk) then
q <= d;
end if;
end process;
end dff_behave;
Read More..