0% found this document useful (0 votes)
40 views3 pages

TCL PracticeQuestions Resources

Uploaded by

yenugulavandhana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views3 pages

TCL PracticeQuestions Resources

Uploaded by

yenugulavandhana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Tcl Practice Questions (50 Questions)

1. Basics & Syntax


1. Print 'Hello VLSI World'.
2. Store your name in a variable and print it.
3. Store two numbers in variables and print their sum.
4. Show the difference between 'set a 10' and 'puts $a'.
5. Print numbers from 1 to 10 using a for loop.

2. Conditionals
6. Check if a number is even or odd.
7. Find the largest of three numbers.
8. Check if a variable is defined before printing it.
9. Write a Tcl script that prints 'Pass' if marks ≥ 40, else 'Fail'.
10. Write a script that checks if a given number is positive, negative, or zero.

3. Loops
11. Print the first 10 natural numbers using a while loop.
12. Print the multiplication table of 5 using a for loop.
13. Print all elements of a list using foreach.
14. Reverse a list using a for loop.
15. Generate the first 10 Fibonacci numbers.

4. Lists & Strings


16. Create a list of subjects: {Maths, EDC, VLSI, Signals} and print them.
17. Find the length of the list.
18. Add 'Networks' to the list.
19. Access the 2nd element from the list.
20. Concatenate two strings 'VLSI' and 'Design'.
21. Extract 'VLSI' from 'Analog VLSI Design'.
22. Convert a string to upper case.
23. Replace 'Analog' with 'Digital' in 'Analog VLSI'.

5. Procedures
24. Write a procedure add {a b} that returns the sum.
25. Write a procedure square {n} that returns square of a number.
26. Write a procedure to calculate factorial of a number.
27. Write a procedure to check if a number is prime.
28. Write a procedure to calculate GCD of two numbers.

6. Practical VLSI Tcl


29. Create a list of cell names: {NAND2 NOR2 INV DFF} and print them using foreach.
30. Write a loop that prints 'Placement step: $i' for i = 1 to 5.
31. Store design stages in a list {Synthesis, Placement, CTS, Routing} and print each on a new line.
32. Write a procedure greet {name} that prints 'Hello $name, welcome to VLSI design flow'.

7. Mathematical Operations
33. Write a Tcl program to calculate the square root of a number.
34. Write a Tcl script to find the sum of digits of a given number.
35. Write a program to check if a number is a palindrome.
36. Write a program to generate the first 10 even numbers.
37. Write a program to find factorial of numbers from 1 to 5 using a loop.

8. Nested Loops
38. Print a pattern using nested loops: *, * *, * * *, * * * *.
39. Print the multiplication tables of numbers 1 to 5 using nested loops.
40. Write a Tcl program to generate all pairs of numbers (i,j) where i=1..3 and j=1..3.

9. Lists & Arrays (Advanced)


41. Create an array with roll numbers as keys and names as values, then print them.
42. Write a script to find the maximum element in a list.
43. Write a script to find the minimum element in a list.
44. Write a script to sort a list {5 2 9 1 3} in ascending order.
45. Merge two lists {1 2 3} and {4 5 6}.

10. String Manipulation


46. Count the number of words in the string 'VLSI is powerful'.
47. Write a program to check if a string is a palindrome.
48. Find the index of 'Design' in the string 'VLSI Design Flow'.

11. VLSI-Oriented Questions


49. Create a list of timing corners {TT SS FF} and print them using a loop.
50. Write a procedure report_stage {stage} that prints 'Currently in $stage stage of Physical
Design'.
Additional Resources

Best Online Tcl Compilers


1. JDoodle Tcl Compiler – https://www.jdoodle.com/execute-tcl-tk-online/
2. TutorialsPoint Tcl Compiler – https://www.tutorialspoint.com/execute_tcl_online.php
3. Replit (Tcl Environment) – https://replit.com/
4. Local Installation (recommended) – Download from https://www.tcl.tk/software/tcltk/

YouTube Channels to Learn Tcl & VLSI Tool Scripting


1. VLSI Academy – Great tutorials on VLSI flows and scripting.
2. Learn VLSI – Covers front-end and back-end tool usage.
3. ChipEdge – Industry-focused training with some Tcl scripting content.
4. SimplyVLSI – Beginner-friendly VLSI concepts with tool demos.
5. Synopsys / Cadence official tool tutorials (search specific tool + Tcl scripting).

You might also like