Apparatus and method for detecting an overflow when shifting N bits of data
AssigneeMitsubishi Denki Kabushiki Kaisha
InventorsShinichi Uramoto, Hideyuki Terane
Life of this patent
Estimating the term…
Abstract
A data comparator detects the coincidence or non-coincidence of the logical states between two adjacent bits of the plural bit input data and applies the comparison result signal to a non-coincident bit detection circuit. A mask generator decodes a shift select signal indicating the amount of shift to produce mask data and applies the produced mask data to a non-coincident bit detection circuit. The non-coincident bit detection circuit masks the output of the data comparator on the basis of the mask data and decides whether or not an overflow is produced from the masked output of the data comparator to output the result of decision.
Claims13
A method of detecting an overflow when shifting bits of n bits of binary coded data in a circuit having a plurality of logical gates, the method comprising the steps of:
- inputting n-bits of a first data to said plurality of logical gates;
- comparing logical states of all adjacent bits of said n-bits of said first data and outputting n-1 bits of a second data, a respective bit of said n-1 bits of said second data being of a first level when said logical states of two adjacent bits of said n-bits of said first data are the same and a second level when said logical states are different;
- masking a predetermined number of bits of n-1 bits of a shift select signal representing a number of bits to be shifted to generate n-1 bits of mask data, a masked bit being set to said first level and said predetermined number being a function of the number to be shifted;
- comparing each bit of n-1 bits of said second data with a corresponding bit of said mask data;
- and
- outputting one of an overflow indication when said step of comparing indicates that both a non-masked bit of said mask data and a corresponding bit of said second data are set to said second level and a no overflow indication when said non-masked bit of said mask data and a corresponding bit of said second data are set to said first level.
A circuit for detecting an overflow when shifting bits of n bits of binary coded data comprising:
- means for comparing logical states of all adjacent bits of said n bits of binary coded data to detect coincidence and outputting n-1 bits of binary coded data, a respective bit of said n-1 bits of binary coded data being of a first level when said logical states of two adjacent bits of said n bits of binary coded data coincide and a second level when said logical states do not coincide;
- mask signal generating means for receiving a shift select signal representing a number of bits to be shifted and generating an n-1 bit mask signal, said mask signal having non-masking bits at bit positions above the number equal to said number of bits to be shifted and having masking bits at the remaining lower bit positions;
- masking means for masking said n-1 bits of binary coded data with said masking bits of said n-1 bit mask signal;
- and
- indicating means for outputting an overflow indication when any bit of non-masked bits of said n-1 bits of binary coded data is equal to said second level.
A circuit for detecting an overflow when shifting bits of n bits of a first data comprising:
- comparator means for comparing logical states of each bit with an adjacent bit of said n bits of said first data to determine whether immediately adjacent bits have same logical states or different logical states and outputting n-1 bits of a second data, a respective bit of said n-1 bits of said second data being of a first logical state when said comparator means determines that the adjacent bits of said n bits of said first data have the same logical states and a second logical state when said comparator means determines that the adjacent bits of said n bits of said first data have different logical states;
- mask signal generating means for receiving n-1 bits of a shift select signal representing a number of bits of said first data are to be shifted and outputting n-1 bits of a mask data with a predetermined number of bits being masked so that a masked bit has the first logical state, said predetermined number being a function of the number of bits to be shifted;
- means for detecting an overflow based on said mask data of said mask signal generating means and said second data of said comparator means.
A method for detecting an overflow when shifting bits of n bits of binary coded data,the method comprising the steps of:
- comparing logical states of all adjacent bits of said n bits of binary coded data to detect coincidence and outputting n-1 bits of binary coded data, a respective bit of said n-1 bits of binary coded data being of a first level when said logical states of two adjacent bits of said n bits of binary coded data coincide and a second level when said logical states do not coincide;
- receiving a shift select signal representing a number of bits to be shifted and generating an n-1 bit mask signal, said mask signal having non-masking bits at bit positions above the number equal to said number of bits to be shifted and having masking bits at the remaining lower bit positions;
- masking said n-1 bits of binary coded data with said masking bits of said n-1 bit mask signal;
- and
- outputting an overflow indication when any bit of non-masked bits of said n-1 bits of binary coded data is equal to said second level.
Dependencies are inferred from the claim text.