# Purpose - Create some $BIT variables
# Create $K and $M variables
# and some bit field extraction variables.
-# Creat helper variables ...
+# Create helper variables ...
# BIT0.. BIT31
for { set x 0 } { $x < 32 } { set x [expr {$x + 1}]} {
# Result: 0x02340000
proc extract_bitfield { VALUE MSB LSB } {
- return [expr [create_mask $MSB $LSB] & $VALUE]
+ return [expr {[create_mask $MSB $LSB] & $VALUE}]
}
# Result: 0x00000234
#
proc normalize_bitfield { VALUE MSB LSB } {
- return [expr [extract_bitfield $VALUE $MSB $LSB ] >> $LSB]
+ return [expr {[extract_bitfield $VALUE $MSB $LSB ] >> $LSB}]
}
proc show_normalize_bitfield { VALUE MSB LSB } {