def hardwareVersionToString (hwversion):
	"""
	Converts a raw integer value into a human readable string a.b.c.d.

	:param int hwversion: raw value as received from the generator
	:return str: a human readable string 'a.b.c.d'.
	"""
	if ((hwversion >> 30) & 1) != 0:
		# new format 30-22 + 21-16
		# mask here with 0xFF instead of 0x3FF to ignore the first two bits
		a = (hwversion >> 22) & 0xFF
		# this one should always be 17
		b = (hwversion >> 16) & 0x3F
		c = (hwversion >> 8) & 0xFF
		d = (hwversion & 0xFF)
	else:
		# old format
		a = 2000 + ((hwversion >> 26) & 0x3F)  # 2000 + first 6 bits (MSB)
		b = (hwversion >> 22) & 0x0F  # 4 next bits
		c = (hwversion >> 16) & 0x3F  # 6 next bits
		d = (hwversion & 0xFFFF)  # last 16 bits (LSB)
	return "%d.%d.%d.%d" % (a, b, c, d)