3.5.1 · HinglishHDL & Digital Design Flow

Verilog - VHDL syntax basics

1,589 words7 min readRead in English

3.5.1 · Hardware › HDL & Digital Design Flow


WHAT: ek HDL kya describe karta hai?


HOW: do core assignment types (iska dil)

Figure — Verilog - VHDL syntax basics

Minimal complete examples


Common mistakes (Steel-man + fix)


Flashcards

Verilog module vs VHDL entity/architecture kya hai?
module interface + behaviour ko ek saath bundle karta hai; VHDL interface (entity, ports) ko internal behaviour (architecture) se alag karta hai.
always @(*) mein combinational logic ke liye kaunsa assignment type use karein?
Blocking =.
always @(posedge clk) ke andar kaunsa assignment type use karein?
Non-blocking <=.
Non-blocking <= flip-flops ko sahi se model kyun karta hai?
Pehle saare right-hand sides sample hote hain, phir saare left-hand sides ek saath update hote hain — yeh parallel edge-triggered registers se match karta hai.
Verilog mein continuous combinational connection kya banata hai?
assign y = f(inputs); (continuous assignment).
always block mein drive hone wale signal ko reg kyun hona chahiye?
Use events ke beech apni value hold karni hoti hai; reg Verilog mein ek variable-type storage hai.
8'hA5 ka matlab kya hai?
Hexadecimal mein ek 8-bit-wide literal, value 10100101.
Inferred latch kya hai aur use kaise avoid karein?
Ek memory element jo tab create hoti hai jab ek combinational output har path par assign nahi hoti; har branch mein saare outputs ko default/assign karke avoid karo.
Kya do alag assign statements ordered hain?
Nahi — yeh concurrent hardware hain, page par order irrelevant hai.
{4'b1010, 4'b0101} kya produce karta hai?
Concatenation → 8-bit value 10100101.

Recall Feynman: ek 12-saal ke bacche ko explain karo

Socho tum ek robot builder ko sirf text mein ek machine describe kar rahe ho. Tum keh sakte ho "yeh wire hamesha inhi do buttons ka AND hai" — woh wire kabhi nahi soti, instantly react karti hai (yeh hai assign). Ya tum keh sakte ho "har baar jab ghanti bajti hai, is wire par jo hai use yaad karo" — yeh ek memory box hai jo sirf ghanti (clock edge) par update hoti hai. Tricky part yeh hai: jab ghanti bajti hai, saare memory boxes ek hi instant mein apne inputs dekhte hain aur phir sab ek saath flip ho jaate hain — isliye hum <= likhte hain matlab "sablog, abhi apni value lo, aur ek saath swap karo," = ki jagah jo matlab hai "yeh abhi karo agle line se pehle."


Connections

  • Combinational vs Sequential Logic — woh do behaviours jinhe HDL styles map karte hain.
  • Flip-Flops and Latchesalways @(posedge clk) kya synthesize karta hai.
  • Synthesis vs Simulation — blocking/non-blocking choice mismatches kyun paida karti hai.
  • Finite State Machines in HDL — dono assignment styles ko combine karta hai.
  • Number Systems and Bit-Widths — literals mein width/base kyun hoti hai.
  • Testbenches — jahan sequential initial/begin..end code software ki tarah sach mein chalta hai.

Concept Map

synthesized into

key mindset

basic block

Verilog

VHDL

two styles

two styles

builds

builds

use =

use less-equals

posedge clk rule

HDL text describes hardware

Actual gates

Concurrent not sequential

Module or Entity

module + ports

entity + architecture

Dataflow assign

Behavioural always/process

Combinational logic

Sequential logic

Blocking assign

Non-blocking assign