Feedback ? Send it to admin@fullchipdesign.com or join me at fullchip@gmail.com
Chip Designing for ASIC/ FPGA Design engineers and Students
Digital-logic Design... Dream for many students… start learning front-end…
Conditional statements in Python.
Function covers for conditional statement.
Step to convert string to hexadecimal value
>> self.idata_f = int(self.idata, 16)
>> self.qdata_f = int(self.qdata, 16)
Step to strip off white space at end
>> self.rfile = string.strip(self.rfile)
Step to convert 12 bit hexadecimal values to 12 bit signed values
if (self.idata_f > (4096/2 - 1)):
self.idata_f = self.idata_f - 4096
if (self.qdata_f > 4096/2 - 1):
self.qdata_f = self.qdata_f - 4096
~\Desktop\cond1.py.html
def cond_statements(self):
self.ci = 0
self.idata = 0
self.qdata = 0
for self.ci in range(10, 11, 1):
self.idata = self.rfile[self.ci] + self.rfile[self.ci+1]+ self.rfile[self.ci+2]
self.qdata = self.rfile[self.ci+5] + self.rfile[self.ci+6] + self.rfile[self.ci+7]
print self.idata, self.qdata