Tuesday, 30 July 2013

The Three Basic Element inside a Computer Chip -






Three Basic Element inside a Compute Chip -



Three Basic Elements inside IC (Learn Verilog with Naresh Singh Dobal Series).



      There are three basic elements in a computer chip, First one is called a transistor and this is the switch just like a light switch, that turn on or off, and flows and block the electricity, this is the three terminal device. 

     Next one is resistor, and resistor slows down the electricity, when electricity passes threw the resistor then it resist the flow of electricity, it’s symbol is like a zigzag line, and this is a two terminal device, and this is very important in electronics, Resistors comes in different values and different sizes. If you see them in real then you can see some band of colors these band actually tells the value of resistance, don’t worry about that I will tell you that how you can identify the value of resistors using color bands.

      The third most important part of an integrated circuit or computer chip is capacitor, and a capacitor stores the electricity, These capacitors makes up of different materials and different sizes, this is basically a two terminal component.
So now if you connect these all components a resistor, transistor and capacitors with the help of wires then you have a some type of electronic circuit. 





     Previous Page                    Next Page     





Let's start with making a Semiconductor Chip -







Lets start with making a Semiconductor Chip -


Let's start with making a semiconductor chip (Learn Verilog with Naresh Singh Dobal series).



       So now let’s talk about that how do you make these amazing computer chips. Before that we should understand what are Integrated circuits, just think like that, a chip is a switch like a light switch, when you turn on the switch then the electricity goes threw it, and light will turn on, and when switch is off, then it’s blocks the current and light will off. So in the case of semiconductor it’s partially conduct the electricity threw it. So when it is ON electricity goes threw it and light will on, and when it is off then its blocks the current and light will off. So now you know every thing about the chip, that they are simply the switch, Cool na… so now you may surprise that ohhh the computer chips are only just like switch! But this is little bit complicated than that, The important thing about these switch are they are made up of sand, and in our semiconductor industry it’s means to silicon. Silicon is the most abundant element on earth. This is very good material to integrate these switches. I recently learn that most of the sand comes from Australia. Because there sand is more pure. 
 
       So now lets talking about the switches, so there are two switches, and you can see at the left when switch is off, then there is no flow of electrons and no flow of current, and in the right image when switch is on, the electrons flows to the other terminal and current flows, so turn these switches on and off like turn it on, turn it off, turn it on and so on, the electricity flows and blocks, according to switch through out the computer chips. Very simple it is.





    Previous Page                         Next Page       

Let's Know about our Semiconductor Industry -






Let's know about our Semiconductor Industry -


Let's know about our semiconductor industry (Learn Verilog with Naresh Singh Dobal).




     So friends, why we are here, I mean to this semiconductor industry. Obviously to make a lot of money, so lets talk about the industry in general, that how important we are, what we do, and how we can make money from this industry, First I would like to tell you some fact about this industry that how big actually this semiconductor industry is, means how much cost of computer chips resell each year, this is approximately 300 billion dollars, this records is according to the year 2010 but today is 2013, so that numbers must be higher, that is our gole, if we talking about the EDA industry then that is about 5.3 billion dollars, The interesting thing is that none of the computer chip and electronic chip will be exist without this EDA industry.


    Now the market drivers, that means to the selling of electronic chip to consumer, The most important thing about the market driver is time to market, that means you have to move the products to the market on time, this is because we generally knows this term that there are some occasions when the demands is high for example many of us plans to purchase a computer system or any other electronic gadgets on Diwali or other festivals, so at that peak time if company is not delivers the products, that reduces the profit, now another critical aspect which effect the vlsi industry is global competition, the chip industry or semiconductor industry was mainly based on US market, few years back Japanese said that they produce the electronic chip cheaper, faster and better quality, and they really affects the US semiconductor market, The US developer says ohhh we don't want to loose the semiconductor market, and takes some major steps. But interesting thing is that, now the semiconductor or chip industry is approximately all over the world. primarily in twain. This was quite interesting. And other aspects are the technology which is use to make chips smaller, faster denser, and lower cost and better quality. Because if you remember the early cell phones they are bigger at 10000Rs, but today you will get these cell phones in 500Rs only, so the cost is lower and lower, and size of systems is also reduces, and it's now smaller, smaller and smaller, so I must say that this technology is very interesting, dynamic, and challenging.





       Previous Page                                                                       Next Page    

Computer Chips are Every-Where (Application of Electronics Chips).





Electronics Chips are Every Where :


Computer Chips are every where (Application of IC) (Learn  Veriog with Naresh Singh Dobal).



 Yes, This is right Computer chips are absolutely every where and in every field, even that places you dont't imagine, so they are in your computers and cellular phones, in your tablets, they are in your gaming systems  like xbox, play stations, they are in i-pods, DVD Players, TV's, watches, They are in automobile like cars, bikes, etc pacemakers, satellites, electronic greeting cards like when you open that some type of sound play from it, So you can say that electronics chips are every where - In communication, medical, Industrial automation, PLC devices, controlling instruments, Electronic gadgets, daily use appliances, in traffic lights etc.






     Previous Page                         Next Page      




Very Important ACRONYMS & TERMS of Semiconductor Industry :








Important ACRONYMS - 


Important Acronyms & Terms of Semiconductor Industry (Learn Verilog with Naresh Singh Dobal).



           So Friends my first question to you is, that what we are, in this electronic semiconductor industry, We are EDA, i.e Electronic Design Automation, As the name indicates that we automating the design of electronics, That means we use computers to design all these complicated chips that may be used in Ipods, Laptops, Display systems, Sound systems, cell-phones, Tablets, Industry automation system, security system, medical etc.  

            The next important thing is CAD that is Computer Aided Design, in the past few deades we are using CAD Tools in every field like mechanical design, civil design, automobile design, IC design, system design etc.

          This is the very important thing in EDA industry that is HDL called Hardware Description Language. This is actually a computer Language, This is very important in VLSI Industry, using HDL we tell the computer to help in design of any integrated circuit, HDL's are working on the same manner that other programming language works that you give some commands to the computer, like computer do this, computer do that .. in this manner. There are many HDL's in market, Here I am telling you about the most popular HDL i.e   VHDL.

         VHDL, stands for  Very High Speed Integrated Circuit Hardware Description Language. Another popular language is Verilog & System Verilog.  So as all other competitive languages there is a language war, that some says VHDL is better, some says no Verilog is good, and some says System Verilog is good. But this is not in that manner, all the language do the same thing but in different manner, It's just like same, some says English is good, some says hindi is good. So people can choose that which they want to use. This may be choose by designer, or by a company or Country wise as well.

          The next important term is RTL,   RTL stands for Register Transfer Level, This is very common term used in EDA industry, This is basically a collection of subsets or collection or commands or the blocks of electronic components having some type of combination or sequential circuit or the basic logical gates.

        PLD's are Programmable Logical Devices, as name suggests, that the devices which can Program a Logic inside it are named as PLD's. There are many type of PLD's in market like PLA (Programmable Logic Array), PAL (Programmable Array Logic),  PROM (Programmable ROM),  SPLD (Simple PLD),  CPLD (Complex PLD), FPGA (Field Programmable Gate Array), ASIC (Application Specific Integrated Circuit).

         ASIC stands for Application Specific Integrated Circuit. First we take a example of general purpose chips like a intel processor, I put that chip in a microwave oven and I say cook my food, and then i places that chip into a traffic light and I say "change the signals according to traffic density", then I put that chip into a security system and say when some one enter in my room then play some sound, Or i place it into a mobile and say ring when someone is calling me, So this a a example of general purpose chips, but if i want a chip that only performs a one very tiny tiny specific function that no other chip can do.So that chip is very much specific to my own application, so lets say I want to make a chip which only tell me when some one walks in my home, that can be specific function, so ASIC are the specific type of chips.

            FPGA : FPGA stands for Field Programmable Gate Array. This is a special type of chip, which can be use for general application, and the more things about FPGA's We will discuss later. When we work on that chips.

           Platform : Platform is basically a foundation where some thing can be stand, but if we talk about VLSI industry then platform means the collection of EDA tools.

           IP : This is a very important term in EDA industry, that may confuse to you with the IP i.e. Internet Protocol, but we nothing to do from that IP in our industry. In our industry IP stands for intellectual property, and there is mainly two expect of intellectual property. So what is Intellectual Property, these are our ideas or inventions or creations which are generated in our head and the reason of intellectual property is so important because if some one steal your ideas and do's that same things, and often gets money it's not related to there business but it's hurts, and This is really a bad thing. So our industry plans of IP. Using these IP we protect the intellectual properties with legal agreements, so intellectual properties is very very important, the second things about the intellectual property is also mean design, chip design and if I come with this brilliant idea of design but I want to protect that and I also want to reuse that so I can build bigger things at top level, so  IP's are the building blocks in a comlex chip designs. And we can use that in the top level designs. Fact is There are thousands of employees works in a industry, but the major thing is ideas, mind, creations, logical thinking, designing abilities.

          Semiconductor : Semiconductor, I am explaining this term in very simple way, semi means partial, conductor means conducting of electricity so what is semiconductor means that some other time this conduct the current threw it or some other times this blocks the electricity.

          IC : IC are integrated circuits or integrated chips.
 




        Previous Page                                                                   Next Page    

Electronics - Trends Setting Points






Electronics - Trends Setting Point :



Electronics : Trend Setting Points (Learn Verilog with Naresh Singh Dobal Series)



       First  I  would like to tell you few interesting things about the trends setting point of this semiconductor industry and electronics. According to a record that is found that the word  "electronics" has first comes in 1894,   Mainly in 1946 or before our early electronics computers use glass valves they called vacuumed tubes. What very interesting that the first electronics computer called INAC that have 18000 valves, that have a weight of 30 tons and takes the power required for the 10 homes. So amazing today's now we dont' take a computer having the weight of 30 tons, now you have the small computers in 1-2 kg only or may be less. Basically the early glass valves glows and produced heat to perform operations. So we have to use very effective cooling environment and ventilation system and the important thing is that when the system fails the debugging of these valves were very difficult.

            In 1947 a first transistor was developed in bell labs, don't worry I will show you a transistor after some time, Early Transistors are near about 40 to 45 dollars, and now the transistors are only 15 cents or less.

           In 1954 a fully Transistorised computer was developed and it was invented by IBM, and this take 2000 separate transistors.


           In 1958 the first integrated circuit normally called IC was invented at Texas Instruments.

           In 1971 the first microprocessor was invented by INTEL, this first microprocessor having 2300 integrated transistors, INTEL - you know about intel that is in intel inside logo, most of the computers and laptops in today life are working on INTEL processors.

           In 1975, this is the most important concept which was developed, and the concept was that the chip complexity i.e How much components or transistors implemented on a single chip, it was predicted that the chip complexity will be double in every 1 and half years,  This concept is called Moore's Law in our industry,  But His original prediction was in 1965, and He said that the number of transistors will be twice in each and every year. But in 1975 after 10 years of that prediction what they found that the chip complexity will be double in every 2 years. So our industry decided according to moore's law and result of last decade that the chip complexity will be twice in every one and half year (18 months), and till this day that is 2013 the moore's law continuously running in the industry.

           In the last point of that history in year 2011 the INTEL again introduced 10 core xion weasteren processor, This particular microprocessor has 2 billion 600 million transistors in a size of your finger point.






        Previous Page                                                                            Next Page    




World of Integrated Chips AND Electronic Design -






World of Integrated Chips AND Electronic Design -




World of Integrated Chips and Electronic Design with Naresh Singh Dobal.








      

                        Welcome you ALL in the ERA of this Interactive session  named  "World of Integrated Chips and Electronic Design,  I  am   "Naresh Singh Dobal",   and I am going to give you some amazing information's about our Semiconductor Industry.

        This small series will give you an idea about the VLSI chips, like how the computer chips are manufacture and how they are designed, This small Tutorial will develop a basic understanding of Semiconductor Industry, Don't Worry about this semiconductor term, I will explain that in my next session,   and more about the EDA,    EDA  is   Electronic Design Automation.

        I will tell you that how EDA are important to our semiconductor industry, because we actually in EDA a small industry, but we belongs to this great thing called Semiconductor Industry.

Also we will follow the very simplified steps to process the manufacturing of computer chips and their designing. 


I really would love for everybody to ask questions to make this tutorial, a interactive series...




                                                                                                                Next Page    

Design of 8 to 3 Parity Encoder using if -else statements (Verilog CODE)






Design of 8 to 3 Parity Encoder using if - else statements -


Output Waveform 1 :  8 to 3 Parity Encoder


Output Waveform :  8 to 3 Parity Encoder

Verilog CODE -


//-----------------------------------------------------------------------------
//
// Title       : parity_encoder
// Design      : verilog upload 4
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog Programs & Exercise with Naresh Singh Dobal
//
//-----------------------------------------------------------------------------
//
// File        : Parity Encoder using if else statement.v


module parity_encoder ( din ,dout );

output [2:0] dout ;
reg [2:0] dout ;

input [7:0] din ;
wire [7:0] din ;


always @ (din) begin
if (din[7])
dout = 0;
else if (din[6])
dout = 1;
else if (din[5])
dout = 2;
else if (din[4])
dout = 3;
else if (din[3])
dout = 4;
else if (din[2])
dout = 5;
else if (din[1])
dout = 6;
else if (din[0])
dout = 7;
else
dout = 3'bZZZ;
end

endmodule

Design of 8 : 3 Parity Encoder using conditional operator






Design of 8 : 3 Parity Encoder using Conditional Operator -


Output Waveform 1 :  8  to  3 Parity Encoder



Output Waveform  :   8  to  3 Parity Encoder

Verilog CODE -



//-----------------------------------------------------------------------------
//
// Title       : parity_encoder
// Design      : verilog upload 4
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog Programs & Exercise with Naresh Singh Dobal
//
//-----------------------------------------------------------------------------
//
// File        : Parity Encoder using conditional operator.v


module parity_encoder ( din ,dout );

output [2:0] dout ;
wire [2:0] dout ;

input [7:0] din ;
wire [7:0] din ;

assign dout = din[7] ?  0 :
 din[6] ?  1 :
 din[5] ?  2 :
 din[4] ?  3 :
 din[3] ?  4 :
 din[2] ?  5 :
 din[1] ?  6 :
 din[0] ?  7 : 1'bzzz ;


endmodule

Monday, 29 July 2013

Design of 8 nibble queue using Behavior Modeling Style (Verilog CODE)-






Design of 8 nibble queue using Behavior Modeling Style -


Output Waveform :  8 nibble queue Design


Verilog CODE -



//-----------------------------------------------------------------------------
//
// Title       : queue_8nibble
// Design      : verilog upload 4
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog Programs & Exercise with Naresh Singh Dobal
//
//-----------------------------------------------------------------------------
//
// File        : 8 nibble queue design using behavior modeling style.v


module queue_8nibble ( din ,clk ,push ,pull ,dout );

output [3:0] dout ;
reg [3:0] dout ;

input [3:0] din ;
wire [3:0] din ;
input clk ;
wire clk ;
input push ;
wire push ;
input pull ;
wire pull ;

reg [3:0]queue[0:7];

integer i;

initial i = 0;

always @ (posedge (clk)) begin
if (push) begin
queue[i] <= din;
if (i<7)
i <= i +1;
end
else if (pull) begin
dout <= queue[0];
queue[0] <= queue[1];
queue[1] <= queue[2];
queue[2] <= queue[3];
queue[3] <= queue[4];
queue[4] <= queue[5];
queue[5] <= queue[6];
queue[6] <= queue[7];
if (i>0)
i <= i -1;
end
end

endmodule

Design of 8 nibble Stack using Behavior Modeling Style (Verilog CODE).





Design of 8 - nibble STACK using Behavior Modeling Style -



Output Waveform : 8 ibble STACK Design


Verilog CODE -



//-----------------------------------------------------------------------------
//
// Title       : stack_8nibble
// Design      : verilog upload 4
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog Programs & Exercise with Naresh Singh Dobal
//
//-----------------------------------------------------------------------------
//
// File        : Design of 8 nibble stack using behavior modeling style.v


module stack_8nibble ( clk ,push ,pull ,din ,dout );

output [3:0] dout ;
reg [3:0] dout ;

input clk ;
wire clk ;
input push ;
wire push ;
input pull ;
wire pull ;
input [3:0] din ;
wire [3:0] din ;

reg [3:0] stack [0:7] ;

reg [3:0] i;

initial i = 0;

always @ (posedge (clk)) begin
if (push) begin
stack[i] <= din;
i <= i + 1;
end else if (pull) begin
dout <= stack[i];
i <= i - 1;
end
end

endmodule

Sunday, 28 July 2013

Design of Parallel IN - Serial OUT Shift Register using Behavior Modeling Style (Verilog CODE).






Design of Parallel In - Serial OUT Shift Register using Behavior Modeling Style -


Output Waveform :  Parallel IN - Serial OUT Shift Register



Verilog CODE -



//-----------------------------------------------------------------------------
//
// Title       : parallel_in_serial_out
// Design      : vhdl_upload2
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog HDL Programs &  Exercise with Naresh Singh Dobal.
//
//-----------------------------------------------------------------------------
//
// File        : Parallel IN -  Serial OUT Shift Register.v


module parallel_in_serial_out ( din ,clk ,reset ,load ,dout );

output dout ;
reg dout ;

input [3:0] din ;
wire [3:0] din ;
input clk ;
wire clk ;
input reset ;
wire reset ;
input load ;
wire load ;

reg [3:0]temp;

always @ (posedge (clk)) begin
if (reset)
temp <= 1;
else if (load)
temp <= din;
else begin
dout <= temp[3];
temp <= {temp[2:0],1'b0};
end
end

endmodule

FPGA / CPLD Based Project






FPGA / CPLD Based Project -



    1. Full Functional Industrial Digital Clock with Time & Alarm Setting with LCD Interfacing.
    2. Interesting 2 Digit Dice Game Project.
    3. Industrial Count Down Timer with Time Setting and Buzzer.
    4. Two Tokan Display with Direct Restart key and hold feature.
    5. GSM Control Robot with LCD Display (Shows Received Commands). 
    6. Metro Train Prototype System With LCD, Motor and automatic Door and Buzzer Interface.
    7. GSM Control Home Appliances.
    8. Wireless RF Controlled Robot With Transmission Power Saving and LCD Display.
    9. RF Controlled robot with lcd display using RF modules
    10. Home aplliances control remotely using RF module with two mode display.
    11. Multi function stepper motor control (direction_rotations).
    12. Sleep Mode time for any electrical appliances (more than 4 hours of timer).
    13. Automatic UV light controller for PCB development process.
    14. Electrical energy saver using home automation.
    15. Automatic auditorium Management system,
    16. Physiometer
    17. Line Following Robot
    18. Obstacle avoiding robot
    19. Wall Following robot
    20. Table anti-falling robot.
    21. Digital Frequency Meter.
    22. Digital Voltmeter
    23. Wireless RF based car parking monitoring & indicator system.
    24. Blind walking stick with pre-recorded voice system.
    25. Temperature controlled automatic fan.
    26. Intelligent street light controller prototype system.
    27. Fastest Finger Detection System.
    28. Temperature controller with hight and low temperature settings.
    29. Password based door locking system.
    30. Contactless Technometer.
    31. Wireless RF Based Object Counter monitoring on veryer belt for industry.
    32. Wireless RF Home Security System.
    33. Wireless RF Code Lock lor car/door security.
    34. Wireless RF Local Positioning system prototype for one vichle.
    35. Telephone call meter.
    36. Dsitance monitoring robot with wireless RF Technolgogy.
    37. Wireless RF based fan speed controller (100 mt range).
    38. Object Following Robot.
    39. Wireless Home/Office Security system against theif, fire, gas leakage with autodialar.
    40. Food Rail.
    41. Automatic Temperature based CPU fan controller.
    42. Multi-functional robot with LCD Display.
    43. Modular Addition Technique (MOD-7).
    44. Industrial Object Counter with faulty Item detection and controlling.
    45. Automatic Garage System with wireless controlled gate and 30 sec. timer.
    46. Automatic  Railway Crossing system.
    47. Full Automatic Water Pump Controlling Device.
    48. Step Based Stepper Motor controlling.
    49. Servo Motor Controlling with 1 degree flexibility.
    50. Prototype of Automatic lift system.
    51. DTMF based contact number logger system.
    52. Number System conversion system.
    53. Fire Fighting robot
    54. 1 min. sound message recorder and re-player system.
    55. Wireless robot control with speed controlling.
    56. Day Calculater
    57. GSM Fan speed Controller.
    58. Digital Controlling of DC motor with wireless RPM measurement.
    59. Digital Bus prototype system.
    60. Controlling electric appliances using IR modules.
    61. Light Following Robot
    62. Wireless Robot control using IR module
    63. Fan speed control using IR module
    64. LPG & CNG gas leackage detector and controller.
    65. Wireless weather monitoring system.
    66. Automatic plant irrigator.
    67. Wireless Pedometer.
    68. Automatic School Bell.
    69. GSM based digital code door lock with password change feature.
    70. Electronic voting machine.
    71. Prototype of automatic hand washer.
    72. Clap operated robot.
    73. Master following robot threw IR sensor.
    74. LED light chaser with different patterns & continuous key speed control.
    75. In/Out Visitor Counter.
    76. GSM controlled automatic and password secured car garrage.
    77. 32 LED  Casino Game with Decreasing running speed.
    78. GSM Controlled Home security system.
    79. Wireless dual dc motor speed and direction control using PWM.
    80. Motor cycle universal gear indicator.
    81. Wireless controlled viewing angle of security camera using two servos.
    82. Wireles servo motor controlling with 10 degree ste (+/-) and lcd display.
    83. IR communication between two devices.
    84. Industrial Verison of Fastest Finger First ystem.
    85. Fixed Digital Frequency Generator with LCD display up to 50 MHz.
    86. Wireless servo motor controlling with LCD display.
    87.  Autonomus path follower with front obstacle detection system.
    88. Automatic 180 degree camera motion control for security with speed control.
    89. Password based time bomb.
    90. Predefined programmed path follower without any line with front obstacle detector.
    91. User programmable path follower without any line with front obstacle detector.
    92. Mobile Controlled DC motor control.
    93. Stepper Motor Control through RF Link.
    94. Potentiometer based stepper motor control.
    95. Timer Based Electronics oven and temperature monitoring.
    96. UART based Digital clock using rs232 protocol.
    97. UART based Temperature logger using rs232 protocol.
    98. UART Based count down timer clock with log data recorder.
    99. UART based type Writer using 6x5 keypad and lcd display.
    100. Microwave oven with automatic temperature and timer.
    101. Real Time Direction Finder of Motor.
    102. Direction and speed Finder of motor.
    103. Two Tokan Display for Fast Food Centers.
    104. Message Moving Display on 5x28 LED matrix for 12 characters.
    105. Communication Encoders and Decoders
    106. Rectangle & circle & Polygen Design using two stepper motor
    107. Advanced Encryption Technique (128 bit encryption) AES
    108. Wireless stepper motor speed and direction control
    109. Automatic washing machine
    110. Path Follower with front obstacle detection & antifalling robot
    111. Digital Clock with alarm flexible settings.

    System Design using Loop Statements (Behavior Modeling Style)






    System Design using LOOP Statements (Behavior Modeling Style) -



    Loops Statemetns (Behavior Modeling Style) -


    • FOR Loop.
    • WHILE Loop.
    • FOREVER Loop.
    • REPEAT Loop.



    FOR Loop Syntax -


    for     ( initilization    ;     condition    ;    increment  ) begin
             
              Sequential Statements   ;

    end




    While Loops Syntax -


    while    (condition)     begin
     
              Sequential Statements    ;

    end




    Forever Loop    Syntax -


    forever     begin

           Sequential Statements    ;

    end





    Repeat Loop    Syntax -


    repeat     (numbers)   begin

             Sequential Statements   ;

    end




    Sample Programs for Loops Statements -





    Design of 4 Bit Adder cum Subtractor using Loops (Behavior Modeling Style) (verilog Code) -





    Design of 4 Bit Adder cum Subtractor using Loops (Behavior Modeling Style) -


    Output Waveform :    4 Bit Adder cum Subtractor


    Verilog CODE -



    //-----------------------------------------------------------------------------
    //
    // Title       : adder_subtractor_4bit
    // Design      : verilog upload 4
    // Author      : Naresh Singh Dobal
    // Company     : nsdobal@gmail.com
    // Verilog Programs & Exercise with Naresh Singh Dobal
    //
    //-----------------------------------------------------------------------------
    //
    // File        : Design of 4 Bit adder cum subtractor.v


    module adder_subtractor_4bit ( a ,b ,sel ,dout );

    output [3:0] dout ;
    reg [3:0] dout ;

    input [3:0] a ;
    wire [3:0] a ;
    input [3:0] b ;
    wire [3:0] b ;
    input sel ;
    wire sel ;

    reg [4:0] s;
    wire [3:0] l;

    integer i;

    assign l = b ^ {sel,sel,sel,sel};

    always @ (a or b or sel) begin
    s[0] = sel;
    for (i=0;i<=3;i=i+1) begin
    dout[i] = a[i] ^ l[i] ^ s[i];
    s[i+1] = (a[i] & l[i]) | (l[i] & s[i]) | (s[i] & a[i]);
    end
    end


    endmodule

    Design of 4 Bit Subtractor using Loops (Behavior Modeling Style) Verilog CODE





    Design of 4 Bit Subtractor using Loops (Behavior Modeling Style) -



    Output Waveform :   4 Bit Subtractor


    Verilog CODE-


    //-----------------------------------------------------------------------------
    //
    // Title       : subtractor_4bit
    // Design      : verilog upload 4
    // Author      : Naresh Singh Dobal
    // Company     : nsdobal@gmail.com
    // Verilog Programs & Exercise with Naresh Singh Dobal
    //
    //-----------------------------------------------------------------------------
    //
    // File        : Design of 4 Bit Subtractor using loops.v


    module subtractor_4bit ( a ,b ,diff ,borrow );

    output [3:0] diff ;
    reg [3:0] diff ;
    output borrow ;
    reg borrow ;

    input [3:0] a ;
    wire [3:0] a ;
    input [3:0] b ;
    wire [3:0] b ;

    reg [4:0]s;
    wire [3:0]l;

    assign l = ~ b;

    integer i;

    always @ (a or b) begin
    s[0] = 1;
    for (i=0;i<=3;i=i+1) begin
    diff[i] = a[i] ^ l[i] ^ s[i];
    s[i+1] = (a[i] & l[i]) | (l[i] & s[i]) | (s[i] & a[i]) ;
    end
    borrow = s[4];
    end

    endmodule

    Design of 4 Bit Adder using Loops (Behavior Modeling Style) (verilog code)






    Design of 4 Bit Adder using Loops (Behavior Modeling Style) -

    Output Waveform :   4 Bit adder



    Verilog CODE- 


    //-----------------------------------------------------------------------------
    //
    // Title       : adder_4bit
    // Design      : verilog upload 4
    // Author      : Naresh Singh Dobal
    // Company     : nsdobal@gmail.com
    // Verilog Programs & Exercise with Naresh Singh Dobal
    //
    //-----------------------------------------------------------------------------
    //
    // File        : Design of 4 bit adder using loop.v


    module adder_4bit ( a ,b ,sum ,carry );

    output [3:0] sum ;
    reg [3:0] sum ;
    output carry ;
    reg carry ;

    input [3:0] a ;
    wire [3:0] a ;
    input [3:0] b ;
    wire [3:0] b ;

    integer i;

    reg [4:0]s;

    always @ (a or b) begin
    s[0] = 0;
    for (i=0;i<=3;i=i+1) begin
    sum [i] = a[i] ^ b[i] ^ s[i];
    s[i+1] = (a[i] & b[i]) | (b[i] & s[i]) | (s[i] & a[i]);
    end
    carry = s[4];
    end

    endmodule

    Design of Stepper Motor Driver (Half Step) using Behavior Model (Verilog CODE) -





    Design of Stepper Motor Driver (Half Step) using Behavior Modeling Style -


    Output Waveform :   Stepper Motor Driver (Half Step).


    Verilog CODE -


    //-----------------------------------------------------------------------------
    //
    // Title       : stepper_motor_half_step
    // Design      : verilog upload 4
    // Author      : Naresh Singh Dobal
    // Company     : nsdobal@gmail.com
    // Verilog Programs & Exercise with Naresh Singh Dobal
    //
    //-----------------------------------------------------------------------------
    //
    // File        : Stepper Motor Driver (Half_step) using Behavior Model.v


    module stepper_motor_half_step ( start ,clk ,dout );

    output [3:0] dout ;
    reg [3:0] dout ;

    input start ;
    wire start ;
    input clk ;
    wire clk ;

    reg [2:0] m;

    initial m = 0;

    always @ (posedge (clk)) begin
    if (start)
    m <= m + 1;
    end

    always @ (m) begin
    case (m)
    0 : dout = 4'b1000;
    1 : dout = 4'b1100;
    2 : dout = 4'b0100;
    3 : dout = 4'b0110;
    4 : dout = 4'b0010;
    5 : dout = 4'b0011;
    6 : dout = 4'b0001;
    default : dout = 4'b1001;
    endcase
    end

    endmodule

    Design of Stepper Motor Driver (Full Step) using Behavior Modeling Style (Verilog CODE) .





    Design of Stepper Motor Driver (Full Step) using Behavior Modeling Style -

    Output Waveform :   Stepper Motor Driver (Full Step).



    Verilog CODE -


    //-----------------------------------------------------------------------------
    //
    // Title       : stepper_motor_full_step
    // Design      : verilog upload 4
    // Author      : Naresh Singh Dobal
    // Company     : nsdobal@gmail.com
    // Verilog Programs & Exercise with Naresh Singh Dobal
    //
    //-----------------------------------------------------------------------------
    //
    // File        : Stepper Motor Driver (Full Step).v


    module stepper_motor_full_step ( start ,clk ,dout );

    output [3:0] dout ;
    reg [3:0] dout ;

    input start ;
    wire start ;
    input clk ;
    wire clk ;

    reg [1:0] m ;

    initial m = 0;

    always @ (posedge (clk)) begin
    if (start)
    m <= m + 1;
    end

    always @ (m) begin
    case (m)
    0 : dout = 8;
    1 : dout = 4;
    2 : dout = 2;
    default : dout = 1;
    endcase
    end

    endmodule

     
    Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes