In [33]:
high = 1
low = 0
mask_elements = 64
bounds = np.empty(shape=[high+1, mask_elements], dtype=np.int32)
for i in range(mask_elements):
bounds[high,i] = (i + 1) * 4 - 1
bounds[low,i] = i * 4
print(" i | High Low \n---|-----------")
for i in range(mask_elements):
print("{:2} | {:4} {:4}".format(i, bounds[high,i], bounds[low,i]))
In [34]:
channels = 4
elements = 320
mask_address = np.empty(shape=[channels, elements], dtype=np.int32)
for i in range(elements):
mask_address[0,i] = i * 4 + 0
mask_address[1,i] = i * 4 + 2
mask_address[2,i] = i * 4 + 1
mask_address[3,i] = i * 4 + 3
print(" i | A B C D \n----|---------------------")
for i in range(elements):
print("{:3} | {:4} {:4} {:4} {:4}".format(i,mask_address[0,i],mask_address[1,i],mask_address[2,i],mask_address[3,i]))
In [18]:
channels = 2
elements = 512
mask_address = np.empty(shape=[channels, elements], dtype=np.int32)
for i in range(elements):
mask_address[0,i] = i * 2 + 0
mask_address[1,i] = i * 2 + 1
print(" i | High Low \n----|-----------")
for i in range(elements):
print("{:3} | {:4} {:4}".format(i,mask_address[0,i],mask_address[1,i]))
In [2]:
channels = 10
data_size = 3
bounds = np.empty(shape=[channels,2], dtype=np.int32)
for i in range(1,channels+1):
bounds[i-1][0] = data_size * i - 1 # High
bounds[i-1][1] = data_size * (i - 1) # Low
print(" i | High Low \n----|-----------")
for i in range(1,channels+1):
print("{:3} | {:4} {:4}".format(i,bounds[i-1,0],bounds[i-1,1]))
In [14]:
g_RAM_FRAME_SIZE = 256
data_size = 3
bounds_left_msn = np.empty(shape=[g_RAM_FRAME_SIZE,2], dtype=np.int32)
bounds_right_msn = np.empty(shape=[g_RAM_FRAME_SIZE,2], dtype=np.int32)
bounds_left_lsn = np.empty(shape=[g_RAM_FRAME_SIZE,2], dtype=np.int32)
bounds_right_lsn = np.empty(shape=[g_RAM_FRAME_SIZE,2], dtype=np.int32)
for i in range(0,g_RAM_FRAME_SIZE / 8 - 1 + 1):
bounds_left_msn[i][0] = (i * 8) + 3
bounds_left_msn[i][1] = (i * 8) + 0
bounds_right_msn[i][0] = (i * 8) + 7
bounds_right_msn[i][1] = (i * 8) + 4
bounds_left_lsn[i][0] = (i * 8) + 7
bounds_left_lsn[i][1] = (i * 8) + 4
bounds_right_lsn[i][0] = (i * 8) + 3
bounds_right_lsn[i][1] = (i * 8) + 0
print(" i | High Low <= High Low | High Low <= High Low\n----|------------------------|-----------------------")
for i in range(0,g_RAM_FRAME_SIZE / 8 - 1 + 1):
print("{:3} | {:4} {:4} <= {:4} {:4} | {:4} {:4} <= {:4} {:4}".format(i,bounds_left_msn[i,0],bounds_left_msn[i,1],bounds_right_msn[i,0],bounds_right_msn[i,1],bounds_left_lsn[i,0],bounds_left_lsn[i,1],bounds_right_lsn[i,0],bounds_right_lsn[i,1]))
In [17]:
channels = 8
data_size = 3
bounds = np.empty(shape=[channels,2], dtype=np.int32)
for i in range(1,channels+1):
bounds[i-1][0] = data_size * i - 1 # High
bounds[i-1][1] = data_size * (i - 1) # Low
print(" i | High Low \n----|-----------")
for i in range(1,channels+1):
print("{:3} | {:4} {:4}".format(i,bounds[i-1,0],bounds[i-1,1]))