Skip to content

This script provides a convenient way to convert floating point numbers to binary fixed values

Notifications You must be signed in to change notification settings

gvikei/magic_converter

This branch is up to date with yazdanbakhsh/magic_converter:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Amir Yazdanbakhsh
Aug 28, 2014
43ff337 · Aug 28, 2014

History

4 Commits
Aug 28, 2014
Aug 28, 2014
Aug 28, 2014

Repository files navigation

This script provides a flexible yet comprehensive way to convert decimal "floating" point numbers to binary "fixed" point numbers and vice versa. The current version(v1.0) only support the conversion between decimal and binary. Other bases will be added soon! There is two possible way to call this script:

1) converter [b2d|d2b] [number of bits] [number of fractions] [binary value | decimal value]

	- [b2d]: 					binary to decimal conversion
	- [d2b]: 					decimal to binary conversion
	- [number of bits]:			total number of bits in the presentation (including sign bit)
	- [number of fractions]:	number of fraction bits in the presentation
	- [binary value]:			the binary value to be converted to decimal
	- [decimal value]:			the decimal valye to be converted to binary

2) converter -f [input file] -o [output file]

	- [input file]:				input file contains the commands to be executed by this script (take a look into the example folder)
	- [output file]: 			output file which all the results will be stored into (take a look into the example folder)

About

This script provides a convenient way to convert floating point numbers to binary fixed values

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%