Rolling the Dice

We all have played dice games when we were kids. The unique thing about a dice is that it gives a random number from 1 to 6 without favoring any number.  How can you make a machine that can generate random numbers? Can a program be written to iterate from 1 to 6 and randomly... Continue Reading →

Mathematics with Python

We learnt about modules in the previous blog. In this blog ,we use a built in module called math to do mathematical operations. The entire list of function in math module is given in math module functions. To use the math module , you need to use import keyword. The statement is written as: import math ... Continue Reading →

Modules

A module is a file containing python definitions( functions and variables) and statements.The file name is the module name with the suffix  .py appended. We need modules to reuse many functions,variables and statements. To import a module in a program, we use the import keyword along with the name of the module. Ex: import operation. The... Continue Reading →

Local and Global Variables

Variable name not defined is a common error faced by programmers. It is very important to know about local and global variable declarations. In this blog, we learn the difference between local and global variables. First thing we need to know here is the definition of scope of a variable. The scope of a variable... Continue Reading →

Patterns

We can use Python to create patterns. Let us see what the following code produces. Let us go through the code step by step. First we define the function called patterncreate which accepts a number n as input. n is the length of the pattern. Here n is the formal parameter of the function. We... Continue Reading →

Recursive functions

We  have seen the role of user defined functions earlier. The main reason why we use a function is because of its re-usability. We can call the same function again and again rather than writing the same piece of code multiple times. Today we will learn about recursive functions. A recursive function is a function... Continue Reading →

Johnson Counter using VERILOG

Johnson counter also known as Switch Tail Counter, consists of shift registers in which the complement of the final register goes as the input for the first register. A Johnson counter is a k ‐bit switch‐tail ring counter with 2 k decoding gates to provide outputs for 2 k timing signals. The eight AND gates... Continue Reading →

Powered by WordPress.com.

Up ↑