Skip to content

Instantly share code, notes, and snippets.

@mikkipastel
Created June 6, 2017 08:40
Show Gist options
  • Save mikkipastel/f710e77a105f51151ec763a7d16427eb to your computer and use it in GitHub Desktop.
Save mikkipastel/f710e77a105f51151ec763a7d16427eb to your computer and use it in GitHub Desktop.
Digital Circuit Design
import math
def base2decimal(num, base):
result = 0
for i in range(len(str(num))):
if (i < len(str(num))):
result += int(int(str(num)[i]) * math.pow(base, i))
print (result)
if __name__=="__main__":
base2decimal(33, 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment